Skip to content

Kirby 6.0.0

$fileGuards->ensureAvailable()

Checks if an action is available to be executed. In comparison to ::ensureExecutable(), this does not validate any input for the action yet. It will only check the ability and the permissions to execute this action. This is typically used to check if UI elements in the Panel should be available or not.

$fileGuards->ensureAvailable(string $action, bool $default = false): void

Parameters

Name Type Default Description
$actionrequired string no default value
$default bool false Used if the action has no permission rule

Exceptions

Parent class

Kirby\Guards\FileGuards inherited from Kirby\Guards\ModelGuards