mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 23:33:13 +08:00
Added list of roles to print after an API is generated
This commit is contained in:
@@ -115,6 +115,11 @@ class ApiKey extends AbstractEntity
|
||||
return $role === null ? [] : $role->meta();
|
||||
}
|
||||
|
||||
public function mapRoles(callable $fun): array
|
||||
{
|
||||
return $this->roles->map(fn (ApiKeyRole $role) => $fun($role->name(), $role->meta()))->getValues();
|
||||
}
|
||||
|
||||
public function registerRole(RoleDefinition $roleDefinition): void
|
||||
{
|
||||
$roleName = $roleDefinition->roleName();
|
||||
|
||||
Reference in New Issue
Block a user