Properties

$roles

$roles : array

Array of roles

Type

array

$resources

$resources : array

Array of resources

Type

array

$allowed

$allowed : array

Array of allowed roles, resources and permissions

Type

array

$denied

$denied : array

Array of denied roles, resources and permissions

Type

array

$assertions

$assertions : array

Array of assertions

Type

array

Methods

__construct()

__construct(\Pop\Acl\AclRole  $role = null, \Pop\Acl\AclResource  $resource = null) 

Constructor

Instantiate the ACL object

Parameters

\Pop\Acl\AclRole $role
\Pop\Acl\AclResource $resource

getRole()

getRole(string  $role) : \Pop\Acl\AclRole

Get a role

Parameters

string $role

Returns

\Pop\Acl\AclRole

getRoles()

getRoles() : array

Get roles

Returns

array

hasRole()

hasRole(string  $role) : boolean

See if a role has been added

Parameters

string $role

Returns

boolean

addRoles()

addRoles(array  $roles) : \Pop\Acl\Acl

Add roles

Parameters

array $roles

Throws

\Pop\Acl\Exception

Returns

\Pop\Acl\Acl

getResource()

getResource(string  $resource) : \Pop\Acl\AclResource

Get a resource

Parameters

string $resource

Returns

\Pop\Acl\AclResource

hasResource()

hasResource(string  $resource) : boolean

See if a resource has been added

Parameters

string $resource

Returns

boolean

getResources()

getResources() : array

Get resources

Returns

array

addResources()

addResources(array  $resources) : \Pop\Acl\Acl

Add resources

Parameters

array $resources

Throws

\Pop\Acl\Exception

Returns

\Pop\Acl\Acl

allow()

allow(mixed  $role, mixed  $resource = null, mixed  $permission = null, \Pop\Acl\Assertion\AssertionInterface  $assertion = null) : \Pop\Acl\Acl

Allow a user role permission to a resource or resources

Parameters

mixed $role
mixed $resource
mixed $permission
\Pop\Acl\Assertion\AssertionInterface $assertion

Throws

\Pop\Acl\Exception

Returns

\Pop\Acl\Acl

removeAllowRule()

removeAllowRule(mixed  $role, mixed  $resource = null, mixed  $permission = null, \Pop\Acl\Assertion\AssertionInterface  $assertion = null) : \Pop\Acl\Acl

Remove an allow rule

Parameters

mixed $role
mixed $resource
mixed $permission
\Pop\Acl\Assertion\AssertionInterface $assertion

Throws

\Pop\Acl\Exception

Returns

\Pop\Acl\Acl

deny()

deny(mixed  $role, mixed  $resource = null, mixed  $permission = null, \Pop\Acl\Assertion\AssertionInterface  $assertion = null) : \Pop\Acl\Acl

Deny a user role permission to a resource or resources

Parameters

mixed $role
mixed $resource
mixed $permission
\Pop\Acl\Assertion\AssertionInterface $assertion

Throws

\Pop\Acl\Exception

Returns

\Pop\Acl\Acl

removeDenyRule()

removeDenyRule(mixed  $role, mixed  $resource = null, mixed  $permission = null, \Pop\Acl\Assertion\AssertionInterface  $assertion = null) : \Pop\Acl\Acl

Remove a deny rule

Parameters

mixed $role
mixed $resource
mixed $permission
\Pop\Acl\Assertion\AssertionInterface $assertion

Throws

\Pop\Acl\Exception

Returns

\Pop\Acl\Acl

isAllowed()

isAllowed(mixed  $role, mixed  $resource = null, mixed  $permission = null) : boolean

Determine if the user is allowed

Parameters

mixed $role
mixed $resource
mixed $permission

Throws

\Pop\Acl\Exception

Returns

boolean

isDenied()

isDenied(mixed  $role, mixed  $resource = null, mixed  $permission = null) : boolean

Determine if the user is denied

Parameters

mixed $role
mixed $resource
mixed $permission

Throws

\Pop\Acl\Exception

Returns

boolean

traverseChildren()

traverseChildren(array  $roles) : void

Traverse child roles to add them to the ACL object

Parameters

array $roles