Permission
in package
Permission
Checks the permission of the public and backend cms
Tags
Table of Contents
Methods
- checkAccess() : bool
- Check access
- createNewDynamicAccessId() : mixed
- Generates a new dynamic access-ID
- getGroupIdsForAccessId() : mixed
- getGroups() : mixed
- Returns an array of all front- or backend groups
- hasAllAccess() : bool
- Checks if the current user is a super user.
- noAccess() : void
- Deny access to the view
- removeAccess() : bool
- Remove access permission for either a single or a bunch of particular groups, in case the $groupId is specified, or otherwise for every group.
- setAccess() : bool
- Set access permission to either a single or a bunch of particular groups.
Methods
checkAccess()
Check access
public
static checkAccess(int $accessId, string $type[, mixed $return = false ]) : bool
Check if the user has the required access id
Parameters
- $accessId : int
- $type : string
- $return : mixed = false
Tags
Return values
boolcreateNewDynamicAccessId()
Generates a new dynamic access-ID
public
static createNewDynamicAccessId() : mixed
Return values
mixed —Returns the newly created dynamic access-ID or FALSE on failure.
getGroupIdsForAccessId()
public
static getGroupIdsForAccessId(mixed $accessId) : mixed
Parameters
- $accessId : mixed
getGroups()
Returns an array of all front- or backend groups
public
static getGroups(bool $frontend) : mixed
Parameters
- $frontend : bool
-
True for frontend access groups, false for backend
Return values
mixed —Array (id=>name) or false on error
hasAllAccess()
Checks if the current user is a super user.
public
static hasAllAccess() : bool
Return values
bool —TRUE if the user is a super user, otherwise FALSE
noAccess()
Deny access to the view
public
static noAccess([mixed $redirect = null ]) : void
If the User is logged in, the "no access" view is shown. This is always the case in the backend. In the frontend, if the User is not logged in, redirects to the login page instead. The redirect target URL is passed along, if any.
Parameters
- $redirect : mixed = null
removeAccess()
Remove access permission for either a single or a bunch of particular groups, in case the $groupId is specified, or otherwise for every group.
public
static removeAccess(mixed $accessId, mixed $type[, mixed $groupId = null ]) : bool
Parameters
- $accessId : mixed
-
integer Affected Access-ID
- $type : mixed
-
string Permission type, which is either 'static' or 'dynamic'
- $groupId : mixed = null
-
mixed Either a single ID as integer or an array of ID's
Return values
bool —TRUE on success, FALSE on failure.
setAccess()
Set access permission to either a single or a bunch of particular groups.
public
static setAccess(mixed $accessId, mixed $type, mixed $groupId) : bool
Parameters
- $accessId : mixed
-
integer Affected Access-ID
- $type : mixed
-
string Permission type, which is either 'static' or 'dynamic'
- $groupId : mixed
-
mixed Either a single ID as integer or an array of ID's
Return values
bool —TRUE on success, FALSE on failure.