Use beginning of UUID for server uuidShort
This commit is contained in:
parent
85e75a2808
commit
36837df0a6
5 changed files with 63 additions and 4 deletions
|
@ -303,6 +303,18 @@ class ServerRepository extends EloquentRepository implements ServerRepositoryInt
|
|||
return $this->getServersForPowerAction($servers, $nodes, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given UUID and UUID-Short string are unique to a server.
|
||||
*
|
||||
* @param string $uuid
|
||||
* @param string $short
|
||||
* @return bool
|
||||
*/
|
||||
public function isUniqueUuidCombo(string $uuid, string $short): bool
|
||||
{
|
||||
return ! $this->getBuilder()->where('uuid', '=', $uuid)->orWhere('uuidShort', '=', $short)->exists();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of server IDs that a given user can access based
|
||||
* on owner and subuser permissions.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue