Prooph\ServiceBus\Plugin\Guard\AuthorizationService::isGranted PHP Method

isGranted() public method

Check if the permission is granted to the current identity
public isGranted ( string $messageName, mixed $context = null ) : boolean
$messageName string
$context mixed
return boolean
    public function isGranted($messageName, $context = null);

Usage Example

Example #1
0
 /**
  * @param ActionEvent $actionEvent
  */
 public function onRoute(ActionEvent $actionEvent)
 {
     if ($this->authorizationService->isGranted($actionEvent->getParam(MessageBus::EVENT_PARAM_MESSAGE_NAME), $actionEvent->getParam(MessageBus::EVENT_PARAM_MESSAGE))) {
         return;
     }
     $actionEvent->stopPropagation(true);
     throw new UnauthorizedException();
 }
All Usage Examples Of Prooph\ServiceBus\Plugin\Guard\AuthorizationService::isGranted
AuthorizationService