Permission
extends AbstractHelper
in package
Permission helper
Tags
Table of Contents
- $permissionDeniedManager : PermissionDeniedManager
- PermissionDenied manager for behavior on denied permissions
- $permissionManager : PermissionManager
- Permission manager to decide if a permission has been granted or not
- __construct() : mixed
- Constructor
- allowDisplay() : bool
- Determine if a local block inside the template should be displayed
- getAlternateContent() : string
- Get content to display in place of blocked content
- isAuthorized() : bool
- Determine if the current user is authorized for a permission.
Properties
$permissionDeniedManager
PermissionDenied manager for behavior on denied permissions
protected
PermissionDeniedManager
$permissionDeniedManager
$permissionManager
Permission manager to decide if a permission has been granted or not
protected
PermissionManager
$permissionManager
Methods
__construct()
Constructor
public
__construct(PermissionManager $permissionManager, PermissionDeniedManager $permissionDeniedManager) : mixed
Parameters
- $permissionManager : PermissionManager
-
Manager to decide if a permission has been granted or not
- $permissionDeniedManager : PermissionDeniedManager
-
Manager for behavior on denied permissions
Return values
mixed —allowDisplay()
Determine if a local block inside the template should be displayed
public
allowDisplay(string $context) : bool
Parameters
- $context : string
-
Name of the permission rule
Return values
bool —getAlternateContent()
Get content to display in place of blocked content
public
getAlternateContent(string $context) : string
Parameters
- $context : string
-
Name of the permission rule
Return values
string —isAuthorized()
Determine if the current user is authorized for a permission.
public
isAuthorized(string $context) : bool
Parameters
- $context : string
-
Name of the permission rule