$siteGuards->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.
$siteGuards->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
| Type | Description |
|---|---|
Kirby\Exception\AbilityExceptionorKirby\Exception\PermissionException |
Parent class
Kirby\Guards\SiteGuards
inherited from Kirby\Guards\ModelGuards