XG Proyect

Permissions
in package

Permissions Class

Tags
category

Classes

author

XG Proyect Team

license

http://www.xgproyect.org XG Proyect

link
http://www.xgproyect.org
version
3.1.0

Table of Contents

ALLOW_ADMIN_MODIFICATION  = false
Defines if the admin role can be modified
$permissions  : array<string|int, mixed>
Contains the permissions array
__construct()  : mixed
Constructor
getAdminModules()  : array<string|int, mixed>
Get list of admin modules (pages)
getAdminSections()  : array<string|int, mixed>
Get the admin sections
getAllPermissionsAsArray()  : array<string|int, mixed>
Get all the permissions as an Array
getAllPermissionsAsJsonString()  : string
Get all the permissions as a JSON
getRoles()  : array<string|int, mixed>
Get a list of roles
grantAccess()  : void
Grant a role access to a new module
isAccessAllowed()  : bool
Check if access is allowed, returns true if it is
moduleExists()  : bool
Check if module exists
removeAccess()  : void
Remove access to a role from a module
roleExists()  : bool
Check if the role exists
savePermissions()  : void
Save permissions to DB
getPermissions()  : array<string|int, mixed>
Get the permissions
isRoleEditable()  : bool
Check if the role is editable
setPermissions()  : void
Set the permissions

Constants

ALLOW_ADMIN_MODIFICATION

Defines if the admin role can be modified

private bool ALLOW_ADMIN_MODIFICATION = false

Properties

$permissions

Contains the permissions array

private array<string|int, mixed> $permissions = []

Methods

__construct()

Constructor

public __construct(string $permissions) : mixed
Parameters
$permissions : string
Return values
mixed

getAdminModules()

Get list of admin modules (pages)

public getAdminModules() : array<string|int, mixed>
Return values
array<string|int, mixed>

getAdminSections()

Get the admin sections

public getAdminSections() : array<string|int, mixed>
Return values
array<string|int, mixed>

getAllPermissionsAsArray()

Get all the permissions as an Array

public getAllPermissionsAsArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

getAllPermissionsAsJsonString()

Get all the permissions as a JSON

public getAllPermissionsAsJsonString() : string
Return values
string

getRoles()

Get a list of roles

public getRoles([bool $no_admin = false ]) : array<string|int, mixed>
Parameters
$no_admin : bool = false
Return values
array<string|int, mixed>

grantAccess()

Grant a role access to a new module

public grantAccess(string $module, int $role) : void
Parameters
$module : string
$role : int
Return values
void

isAccessAllowed()

Check if access is allowed, returns true if it is

public isAccessAllowed(string $module, int $role) : bool
Parameters
$module : string
$role : int
Return values
bool

moduleExists()

Check if module exists

public moduleExists(string $module) : bool
Parameters
$module : string
Return values
bool

removeAccess()

Remove access to a role from a module

public removeAccess(string $module, int $role) : void
Parameters
$module : string
$role : int
Return values
void

roleExists()

Check if the role exists

public roleExists(string $role) : bool
Parameters
$role : string
Return values
bool

savePermissions()

Save permissions to DB

public savePermissions() : void
Return values
void

getPermissions()

Get the permissions

private getPermissions() : array<string|int, mixed>
Return values
array<string|int, mixed>

isRoleEditable()

Check if the role is editable

private isRoleEditable(int $role) : bool
Parameters
$role : int
Return values
bool

setPermissions()

Set the permissions

private setPermissions(string $permissions) : void
Parameters
$permissions : string
Return values
void

Search results