\Charcoal\User\AclRole

ACL Roles define hierarchical allowed and denied permissions.

They can be attached to user accounts for fine-grained permission control.

Summary

Methods
Properties
Constants
__toString()
setParent()
parent()
setAllowed()
allowed()
setDenied()
denied()
setSuperuser()
superuser()
setPosition()
position()
$ident
$parent
$allowed
$denied
SEPARATOR
No protected methods found
No protected properties found
N/A
No private methods found
$superuser
$position
N/A

Constants

SEPARATOR

SEPARATOR

Properties

$ident

$ident : string

Type

string

$parent

$parent : string

The parent ACL role.

This role will inherit all of its parent's permissions.

Type

string

$allowed

$allowed : array<mixed,string>|null

List of explicitely allowed permissions.

Type

array<mixed,string>|null

$denied

$denied : array<mixed,string>|null

List of explicitely denied permissions.

Type

array<mixed,string>|null

$superuser

$superuser : boolean

Type

boolean

$position

$position : integer

Type

integer

Methods

__toString()

__toString() : string

ACL Role can be used as a string (ident).

Returns

string

setParent()

setParent(string  $parent) : \Charcoal\User\Acl\AclRole

Parameters

string $parent

Role's parent.

Returns

\Charcoal\User\Acl\AclRole —

Chainable

parent()

parent() : string

Returns

string

setAllowed()

setAllowed(array<mixed,string>|string|null  $allowed) : \Charcoal\User\Acl\AclRole

Parameters

array<mixed,string>|string|null $allowed

The allowed permissions for this role.

Throws

\Charcoal\User\Acl\InvalidArgumentException

If the passed arguments is not an array, null, or a comma-separated string.

Returns

\Charcoal\User\Acl\AclRole —

Chainable

allowed()

allowed() : array<mixed,string>|null

Returns

array<mixed,string>|null

setDenied()

setDenied(array<mixed,string>|string|null  $denied) : \Charcoal\User\Acl\AclRole

Parameters

array<mixed,string>|string|null $denied

The denied permissions for this role.

Throws

\Charcoal\User\Acl\InvalidArgumentException

If the passed arguments is not an array, null, or a comma-separated string.

Returns

\Charcoal\User\Acl\AclRole —

Chainable

denied()

denied() : array<mixed,string>|null

Returns

array<mixed,string>|null

setSuperuser()

setSuperuser(boolean  $isSuper) : \Charcoal\User\Acl\AclRole

Parameters

boolean $isSuper

The superuser flag.

Returns

\Charcoal\User\Acl\AclRole —

Chainable

superuser()

superuser() : boolean

Returns

boolean

setPosition()

setPosition(integer  $position) : \Charcoal\User\Acl\AclRole

Parameters

integer $position

The role's ordering position.

Returns

\Charcoal\User\Acl\AclRole —

Chainable

position()

position() : integer

Returns

integer