mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-07 07:43:12 +08:00
Applied API role specs to short URL creation
This commit is contained in:
@@ -83,4 +83,11 @@ class ApiKey extends AbstractEntity
|
||||
{
|
||||
return $this->roles->exists(fn ($key, ApiKeyRole $role) => $role->name() === $roleName);
|
||||
}
|
||||
|
||||
public function getRoleMeta(string $roleName): array
|
||||
{
|
||||
/** @var ApiKeyRole|false $role */
|
||||
$role = $this->roles->filter(fn (ApiKeyRole $role) => $role->name() === $roleName)->first();
|
||||
return ! $role ? [] : $role->meta();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user