Table Of Contents

Previous topic

< Class Phalcon\Version

Next topic

Interface Phalcon\Acl\ResourceInterface >

Interface Phalcon\Acl\AdapterInterface

Phalcon\Acl\AdapterInterface initializer

Methods

abstract public setDefaultAction (int $defaultAccess)

Sets the default access level (Phalcon\Acl::ALLOW or Phalcon\Acl::DENY)

abstract public int getDefaultAction ()

Returns the default ACL access level

abstract public boolean addRole (Phalcon\Acl\RoleInterface $role, [string $accessInherits])

Adds a role to the ACL list. Second parameter lets to inherit access data from other existing role

abstract public addInherit (string $roleName, string $roleToInherit)

Do a role inherit from another existing role

abstract public boolean isRole (string $roleName)

Check whether role exist in the roles list

abstract public boolean isResource (string $resourceName)

Check whether resource exist in the resources list

abstract public boolean addResource (Phalcon\Acl\ResourceInterface $resource, [array $accessList])

Adds a resource to the ACL list Access names can be a particular action, by example search, update, delete, etc or a list of them

abstract public addResourceAccess (string $resourceName, mixed $accessList)

Adds access to resources

abstract public dropResourceAccess (string $resourceName, mixed $accessList)

Removes an access from a resource

abstract public allow (string $roleName, string $resourceName, mixed $access)

Allow access to a role on a resource

abstract public boolean deny (string $roleName, string $resourceName, mixed $access)

Deny access to a role on a resource

abstract public boolean isAllowed (string $role, string $resource, string $access)

Check whether a role is allowed to access an action from a resource

abstract public string getActiveRole ()

Returns the role which the list is checking if it’s allowed to certain resource/access

abstract public string getActiveResource ()

Returns the resource which the list is checking if some role can access it

abstract public string getActiveAccess ()

Returns the access which the list is checking if some role can access it

abstract public Phalcon\Acl\RoleInterface [] getRoles ()

Return an array with every role registered in the list

abstract public Phalcon\Acl\ResourceInterface [] getResources ()

Return an array with every resource registered in the list