Skip to content

Kirby 6.0.0

$permissions->for()

Returns the permission for a category or a specific action or the $default if it is not defined

$permissions->for(string $category, string|null $action = null, bool|null $default = false): bool|null

Parameters

Name Type Default
$categoryrequired string no default value
$action stringornull null
$default boolornull false

Return types

boolornull

Exceptions

Type Description
Kirby\Exception\LogicException if the permission value is not a boolean

Parent class

Kirby\Cms\Permissions