Skip to content

Kirby 6.0.0

$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): Role|null

Parameters

Name Type Default Description
$id stringornull 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\Roleornull

Parent class

Kirby\Cms\App