$kirby->role()
Returns a specific user role by id or the role of the current user if no id is given
$kirby->role(string|null $id = null, bool $allowImpersonation = true): Kirby\Cms\Role|null
Parameters
Name | Type | Default | Description |
---|---|---|---|
$id | string ornull |
null
|
|
$allowImpersonation | bool |
true
|
If set to false, only the role of the actually logged in user will be returned (when $id is passed as null ) |
Return types
Kirby\Cms\Role
ornull