PHP Class ZfcRbac\Guard\ControllerGuard

Author: Michaël Gallego ([email protected])
Inheritance: extends AbstractGuard, use trait ProtectionPolicyTrait
ファイルを表示 Open project: zf-commons/zfc-rbac Class Usage Examples

Protected Properties

Property Type Description
$roleService ZfcRbac\Service\RoleService
$rules array Controller guard rules

Public Methods

Method Description
__construct ( RoleService $roleService, array $rules = [] ) Constructor
isGranted ( MvcEvent $event ) {@inheritDoc}
setRules ( array $rules ) : void Set the rules

Method Details

__construct() public method

Constructor
public __construct ( RoleService $roleService, array $rules = [] )
$roleService ZfcRbac\Service\RoleService
$rules array

isGranted() public method

{@inheritDoc}
public isGranted ( MvcEvent $event )
$event Zend\Mvc\MvcEvent

setRules() public method

A controller rule is made the following way: [ 'controller' => 'ControllerName', 'actions' => []/string 'roles' => []/string ]
public setRules ( array $rules ) : void
$rules array
return void

Property Details

$roleService protected_oe property

protected RoleService,ZfcRbac\Service $roleService
return ZfcRbac\Service\RoleService

$rules protected_oe property

Controller guard rules
protected array $rules
return array