메소드 |
설명 |
|
__construct ( $redis = null ) |
|
|
addInherit ( string $roleName, Phalcon\Acl\Role | string $roleToInherit ) |
|
|
addResource ( Phalcon\Acl\Resource | string $resource, array | string $accessList = null ) : boolean |
{@inheritdoc}
Example:
Add a resource to the the list allowing access to an action
$acl->addResource(new Phalcon\Acl\Resource('customers'), 'search');
$acl->addResource('customers', 'search');
Add a resource with an access list
$acl->addResource(new Phalcon\Acl\Resource('customers'), ['create', 'search']);
$acl->addResource('customers', ['create', 'search']);
|
|
addResourceAccess ( string $resourceName, array | string $accessList ) : boolean |
|
|
addRole ( Phalcon\Acl\Role | string $role, string $accessInherits = null ) : boolean |
|
|
allow ( string $role, string $resource, array | string $access, mixed $func = null ) |
{@inheritdoc}
You can use '*' as wildcard
Example:
Allow access to guests to search on customers
$acl->allow('guests', 'customers', 'search');
Allow access to guests to search or create on customers
$acl->allow('guests', 'customers', ['search', 'create']);
Allow access to any role to browse on products
$acl->allow('*', 'products', 'browse');
Allow access to any role to browse on any resource
$acl->allow('*', '*', 'browse');
|
|
deny ( $role, $resource, array | string $access, mixed $func = null ) |
{@inheritdoc}
You can use '*' as wildcard
Example:
Deny access to guests to search on customers
$acl->deny('guests', 'customers', 'search');
Deny access to guests to search or create on customers
$acl->deny('guests', 'customers', ['search', 'create']);
Deny access to any role to browse on products
$acl->deny('*', 'products', 'browse');
Deny access to any role to browse on any resource
$acl->deny('*', '*', 'browse');
|
|
dropResourceAccess ( string $resource, array | string $accessList ) |
|
|
getNoArgumentsDefaultAction ( ) : integer |
Returns the default ACL access level for no arguments provided
in isAllowed action if there exists func for accessKey |
|
getRedis ( ) |
|
|
getResourceAccess ( $resource ) |
|
|
getResources ( ) : Phalcon\Acl\Resource[] |
|
|
getRoleInherits ( $role ) : array |
|
|
getRoles ( ) : Phalcon\Acl\RoleInterface[] |
|
|
isAllowed ( string $role, string $resource, string $access, array $parameters = null ) : boolean |
{@inheritdoc}
Example:
Does Andres have access to the customers resource to create?
$acl->isAllowed('Andres', 'Products', 'create');
Do guests have access to any resource to edit?
$acl->isAllowed('guests', '*', 'edit');
|
|
isResource ( string $resourceName ) : boolean |
|
|
isResourceAccess ( $resource, $access ) |
|
|
isRole ( string $roleName ) : boolean |
|
|
setNoArgumentsDefaultAction ( integer $defaultAccess ) |
Sets the default access level for no arguments provided
in isAllowed action if there exists func for accessKey |
|
setRedis ( $redis, $chainRedis = false ) |
|
|