/**
  * Check State Transition possible for User 
  * 
  * @param type $workFlowId
  * @param type $state
  * @param type $action
  * @return boolean 
  */
 public function isActionAllowed($workFlowId, $state, $action, $rolesToExclude = array(), $rolesToInclude = array(), $entities = array())
 {
     $accessFlowStateMachineService = new AccessFlowStateMachineService();
     $isAllowed = FALSE;
     $filteredRoles = $this->filterRoles($this->userRoles, $rolesToExclude, $rolesToInclude, $entities);
     foreach ($filteredRoles as $role) {
         $isAllowed = $accessFlowStateMachineService->isActionAllowed($workFlowId, $state, $role->getName(), $action);
         if ($isAllowed) {
             break;
         }
     }
     return $isAllowed;
 }
Exemplo n.º 2
0
 /**
  * Check State Transition possible for User 
  * 
  * @param type $workFlowId
  * @param type $state
  * @param type $action
  * @return boolean 
  */
 public function isActionAllowed($workFlowId, $state, $action)
 {
     $accessFlowStateMachineService = new AccessFlowStateMachineService();
     $isAllowed = FALSE;
     foreach ($this->userRoles as $role) {
         $isAllowed = $accessFlowStateMachineService->isActionAllowed($workFlowId, $state, $role, $action);
         if ($isAllowed) {
             break;
         }
     }
     return $isAllowed;
 }