Permission accessor helper.

package XenForo_Permissions

 Methods

Gets the value (true, false, or int) of the specified content permission, if it exists.

hasContentPermission(array $contentPermissions, string $permission) : true | false | int
Static

This differs from hasPermission() in that there is no group specified. The first dimension has the permissions.

If the specified permission exists but is an array, an exception will be thrown.

Parameters

$contentPermissions

array

Format: [permission] => value

$permission

string

Permission ID

Returns

truefalseintFalse if the permission isn't found; the value of the permission otherwise

Gets the value (true, false, or int) of the specified permission if it exists.

hasPermission(array $permissions, string $group, string $permission) : true | false | int
Static

Used for global permissions which have a group and an individual permission.

Parameters

$permissions

array

Grouped permissions ([group][permission] => value)

$group

string

Permission group

$permission

string

Permission ID

Returns

truefalseintFalse if the permission isn't found; the value of the permission otherwise

Unserialize permissions from their format in the database to the array format that the other helper functions expect.

unserializePermissions(string $permissionString) : array
Static

Parameters

$permissionString

string

Returns

array

Private constructor.

__construct() 

Use statically.