\rex_structure_perm

Abstract class for complex permissions.

Summary

Methods
Properties
Constants
hasAll()
getFieldParams()
register()
getAll()
get()
removeItem()
replaceItem()
hasCategoryPerm()
hasStructurePerm()
getMountpoints()
hasMountpoints()
getMountpointCategories()
No public properties found
ALL
__construct()
$user
$perms
N/A
No private methods found
No private properties found
N/A

Constants

ALL

ALL = 'all'

Properties

$user

$user : \rex_user

User instance.

Type

rex_user

$perms

$perms : array

Array of permissions.

Type

array

Methods

hasAll()

hasAll() : bool

Returns if the user has the permission for all items.

Returns

bool —

getFieldParams()

getFieldParams() : array

Returns the field params for the role form.

Returns

array —

register()

register(string  $key, string  $class) : mixed

Registers a new complex perm class.

Parameters

string $key

Key for the complex perm

string $class

Class name

Throws

\InvalidArgumentException

Returns

mixed —

getAll()

getAll() : array

Returns all complex perm classes.

Returns

array —

Class names

get()

get(\rex_user  $user, string  $key, mixed  $perms = []) : self|null

Returns the complex perm.

Parameters

\rex_user $user

User instance

string $key

Complex perm key

mixed $perms

Permissions

Returns

self|null —

removeItem()

removeItem(string  $key, string|int  $item) : mixed

Should be called if an item is removed.

Parameters

string $key

Key

string|int $item

Item

Returns

mixed —

replaceItem()

replaceItem(string  $key, string|int  $item, string|int  $new) : mixed

Should be called if an item is replaced.

Parameters

string $key

Key

string|int $item

Old item

string|int $new

New item

Returns

mixed —

hasCategoryPerm()

hasCategoryPerm(int  $categoryId) : bool

Parameters

int $categoryId

Returns

bool —

hasStructurePerm()

hasStructurePerm() : bool

Returns

bool —

getMountpoints()

getMountpoints() : array

Returns

array —

hasMountpoints()

hasMountpoints() : bool

Returns

bool —

getMountpointCategories()

getMountpointCategories() : \rex_category[]

Returns

\rex_category[] —

__construct()

__construct(\rex_user  $user, mixed  $perms) : mixed

Constructor.

Parameters

\rex_user $user

User instance

mixed $perms

Permissions

Returns

mixed —