mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 23:33:13 +08:00
Applied API role specs to domains list
This commit is contained in:
@@ -76,6 +76,11 @@ class ApiKey extends AbstractEntity
|
||||
|
||||
public function isAdmin(): bool
|
||||
{
|
||||
return $this->roles->count() === 0;
|
||||
return $this->roles->isEmpty();
|
||||
}
|
||||
|
||||
public function hasRole(string $roleName): bool
|
||||
{
|
||||
return $this->roles->exists(fn ($key, ApiKeyRole $role) => $role->name() === $roleName);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user