PHP Class Resource_Acl

Inheritance: extends Zend_Application_Resource_ResourceAbstract
Exibir arquivo Open project: sourcefabric/newscoop Class Usage Examples

Public Methods

Method Description
getAccess ( string $controller, string $action ) : array Get access
getAcl ( Zend_Acl_Role_Interface $role ) : Zend_Acl Get acl for role
getActions ( string $resource = '' ) : array Get resource actions
getResources ( ) : array Get application resources
init ( ) Init acl
isAllowed ( Zend_Acl_Role_Interface $role, string $resource, string $action ) : boolean Check access
setStorage ( Resource\Acl\StorageInterface $storage ) : Resource_Acl Set acl storage

Private Methods

Method Description
addRules ( Zend_Acl $acl, Zend_Acl_Role_Interface $role ) : void Add role rules
formatName ( string $name, string $module = '' ) : string Format name for resource/action
getAnnotationReader ( ) : AnnotationReader Get annotation reader
getStorage ( ) : Resource\Acl\StorageInterface Get acl storage
scan ( ) : void Scan for resources/actions

Method Details

getAccess() public method

Get access
public getAccess ( string $controller, string $action ) : array
$controller string
$action string
return array (resource, action)

getAcl() public method

Get acl for role
public getAcl ( Zend_Acl_Role_Interface $role ) : Zend_Acl
$role Zend_Acl_Role_Interface
return Zend_Acl

getActions() public method

Get resource actions
public getActions ( string $resource = '' ) : array
$resource string
return array

getResources() public method

Get application resources
public getResources ( ) : array
return array

init() public method

Init acl
public init ( )

isAllowed() public method

Check access
public isAllowed ( Zend_Acl_Role_Interface $role, string $resource, string $action ) : boolean
$role Zend_Acl_Role_Interface
$resource string
$action string
return boolean

setStorage() public method

Set acl storage
public setStorage ( Resource\Acl\StorageInterface $storage ) : Resource_Acl
$storage Resource\Acl\StorageInterface
return Resource_Acl