PHP 클래스 Phalcon\Acl\Adapter\Redis

Manages ACL lists in Redis Database
상속: extends Phalcon\Acl\Adapter
파일 보기 프로젝트 열기: phalcon/incubator 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$noArgumentsDefaultAction integer Default action for no arguments is allow
$redis Redis
$setNXAccess boolean

공개 메소드들

메소드 설명
__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 )

보호된 메소드들

메소드 설명
allowOrDeny ( string $roleName, string $resourceName, array | string $access, integer $action ) Inserts/Updates a permission in the access list
resourcePermission ( $role, $access, $allowOrDeny )
rolePermission ( $resource, $access, $allowOrDeny )
setAccess ( $roleName, $resourceName, $accessName, $action ) : boolean

메소드 상세

__construct() 공개 메소드

public __construct ( $redis = null )

addInherit() 공개 메소드

public addInherit ( string $roleName, Phalcon\Acl\Role | string $roleToInherit )
$roleName string
$roleToInherit Phalcon\Acl\Role | string

addResource() 공개 메소드

{@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']);
public addResource ( Phalcon\Acl\Resource | string $resource, array | string $accessList = null ) : boolean
$resource Phalcon\Acl\Resource | string
$accessList array | string
리턴 boolean

addResourceAccess() 공개 메소드

public addResourceAccess ( string $resourceName, array | string $accessList ) : boolean
$resourceName string
$accessList array | string
리턴 boolean

addRole() 공개 메소드

Example: $acl->addRole(new Phalcon\Acl\Role('administrator'), 'consultor'); $acl->addRole('administrator', 'consultor');
public addRole ( Phalcon\Acl\Role | string $role, string $accessInherits = null ) : boolean
$role Phalcon\Acl\Role | string
$accessInherits string
리턴 boolean

allow() 공개 메소드

{@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');
public allow ( string $role, string $resource, array | string $access, mixed $func = null )
$role string
$resource string
$access array | string
$func mixed

allowOrDeny() 보호된 메소드

Inserts/Updates a permission in the access list
protected allowOrDeny ( string $roleName, string $resourceName, array | string $access, integer $action )
$roleName string
$resourceName string
$access array | string
$action integer

deny() 공개 메소드

{@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');
public deny ( $role, $resource, array | string $access, mixed $func = null )
$access array | string
$func mixed

dropResourceAccess() 공개 메소드

public dropResourceAccess ( string $resource, array | string $accessList )
$resource string
$accessList array | string

getNoArgumentsDefaultAction() 공개 메소드

Returns the default ACL access level for no arguments provided in isAllowed action if there exists func for accessKey

getRedis() 공개 메소드

public getRedis ( )

getResourceAccess() 공개 메소드

public getResourceAccess ( $resource )

getResources() 공개 메소드

public getResources ( ) : Phalcon\Acl\Resource[]
리턴 Phalcon\Acl\Resource[]

getRoleInherits() 공개 메소드

public getRoleInherits ( $role ) : array
$role
리턴 array

getRoles() 공개 메소드

public getRoles ( ) : Phalcon\Acl\RoleInterface[]
리턴 Phalcon\Acl\RoleInterface[]

isAllowed() 공개 메소드

{@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');
public isAllowed ( string $role, string $resource, string $access, array $parameters = null ) : boolean
$role string
$resource string
$access string
$parameters array
리턴 boolean

isResource() 공개 메소드

public isResource ( string $resourceName ) : boolean
$resourceName string
리턴 boolean

isResourceAccess() 공개 메소드

public isResourceAccess ( $resource, $access )

isRole() 공개 메소드

public isRole ( string $roleName ) : boolean
$roleName string
리턴 boolean

resourcePermission() 보호된 메소드

protected resourcePermission ( $role, $access, $allowOrDeny )
$role
$access
$allowOrDeny

rolePermission() 보호된 메소드

protected rolePermission ( $resource, $access, $allowOrDeny )
$resource
$access
$allowOrDeny

setAccess() 보호된 메소드

protected setAccess ( $roleName, $resourceName, $accessName, $action ) : boolean
$roleName
$resourceName
$accessName
$action
리턴 boolean

setNoArgumentsDefaultAction() 공개 메소드

Sets the default access level for no arguments provided in isAllowed action if there exists func for accessKey
public setNoArgumentsDefaultAction ( integer $defaultAccess )
$defaultAccess integer Phalcon\Acl::ALLOW or Phalcon\Acl::DENY

setRedis() 공개 메소드

public setRedis ( $redis, $chainRedis = false )

프로퍼티 상세

$noArgumentsDefaultAction 보호되어 있는 프로퍼티

Default action for no arguments is allow
protected int $noArgumentsDefaultAction
리턴 integer

$redis 보호되어 있는 프로퍼티

protected Redis,Phalcon\Acl\Adapter $redis
리턴 Redis

$setNXAccess 보호되어 있는 프로퍼티

protected bool $setNXAccess
리턴 boolean