PermissionDeniedManager
in package
Permission Manager
Tags
Table of Contents
- $config : array<string|int, mixed>
- List config
- $defaultDeniedControllerBehavior : string|bool
- Default behavior for denied permissions at the controller level.
- $defaultDeniedTemplateBehavior : string|bool
- Default behavior for denied permissions at the template level.
- __construct() : mixed
- Constructor
- getDeniedControllerBehavior() : array<string|int, mixed>|bool
- Get behavior to apply when a controller denies a permission.
- getDeniedTemplateBehavior() : array<string|int, mixed>|bool
- Get behavior to apply when a template denies a permission.
- setDefaultDeniedControllerBehavior() : void
- Set the default behavior for a denied controller permission
- setDefaultDeniedTemplateBehavior() : void
- Set the default behavior for a denied template permission
- getDeniedBehavior() : array<string|int, mixed>|bool
- Get permission denied logic
- processConfigString() : array<string|int, mixed>
- Translate a configuration string into an array.
Properties
$config
List config
protected
array<string|int, mixed>
$config
$defaultDeniedControllerBehavior
Default behavior for denied permissions at the controller level.
protected
string|bool
$defaultDeniedControllerBehavior
= 'promptLogin'
$defaultDeniedTemplateBehavior
Default behavior for denied permissions at the template level.
protected
string|bool
$defaultDeniedTemplateBehavior
= false
(False means "do nothing").
Methods
__construct()
Constructor
public
__construct(array<string|int, mixed> $config) : mixed
Parameters
- $config : array<string|int, mixed>
-
configuration
Return values
mixed —getDeniedControllerBehavior()
Get behavior to apply when a controller denies a permission.
public
getDeniedControllerBehavior(string $permission[, string $defaultBehavior = null ]) : array<string|int, mixed>|bool
Parameters
- $permission : string
-
Permission that has been denied
- $defaultBehavior : string = null
-
Default behavior to use if none configured (null to use default configured in this class, false to take no action).
Return values
array<string|int, mixed>|bool —Associative array of behavior for the given permission (containing the keys 'action', 'value', 'params' and 'exceptionMessage' for exceptions) or false if no action needed.
getDeniedTemplateBehavior()
Get behavior to apply when a template denies a permission.
public
getDeniedTemplateBehavior(string $permission[, string $defaultBehavior = null ]) : array<string|int, mixed>|bool
Parameters
- $permission : string
-
Permission that has been denied
- $defaultBehavior : string = null
-
Default action to use if none configured (null to use default configured in this class, false to take no action).
Return values
array<string|int, mixed>|bool —setDefaultDeniedControllerBehavior()
Set the default behavior for a denied controller permission
public
setDefaultDeniedControllerBehavior(string|bool $value) : void
Parameters
- $value : string|bool
-
Default behavior for a denied controller permission
Return values
void —setDefaultDeniedTemplateBehavior()
Set the default behavior for a denied template permission
public
setDefaultDeniedTemplateBehavior(string|bool $value) : void
Parameters
- $value : string|bool
-
Default behavior for a denied template permission
Return values
void —getDeniedBehavior()
Get permission denied logic
protected
getDeniedBehavior(string $permission, string $mode, string $defaultBehavior) : array<string|int, mixed>|bool
Parameters
- $permission : string
-
Permission that has been denied
- $mode : string
-
Mode of the operation. Should be either deniedControllerBehavior or deniedTemplateBehavior
- $defaultBehavior : string
-
Default action to use if none configured
Return values
array<string|int, mixed>|bool —processConfigString()
Translate a configuration string into an array.
protected
processConfigString(string $config) : array<string|int, mixed>
Parameters
- $config : string
-
Configuration string to process