PHP Class ZfcRbac\Guard\ControllerPermissionsGuard

Author: Michaël Gallego ([email protected])
Author: JM Leroux ([email protected])
Inheritance: extends AbstractGuard, use trait ProtectionPolicyTrait
Mostra file Open project: zf-commons/zfc-rbac Class Usage Examples

Protected Properties

Property Type Description
$authorizationService ZfcRbac\Service\AuthorizationServiceInterface
$rules array Controller guard rules

Public Methods

Method Description
__construct ( ZfcRbac\Service\AuthorizationServiceInterface $authorizationService, array $rules = [] ) Constructor
isGranted ( MvcEvent $event ) {@inheritDoc}
setRules ( array $rules ) : void Set the rules

Method Details

__construct() public method

Constructor
public __construct ( ZfcRbac\Service\AuthorizationServiceInterface $authorizationService, array $rules = [] )
$authorizationService ZfcRbac\Service\AuthorizationServiceInterface
$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

$authorizationService protected_oe property

protected AuthorizationServiceInterface,ZfcRbac\Service $authorizationService
return ZfcRbac\Service\AuthorizationServiceInterface

$rules protected_oe property

Controller guard rules
protected array $rules
return array