コード例 #1
0
 /**
  * Get actions that this user can perform on a perticular workflow with the current state
  * @param int $workFlow
  * @param string $state
  * @return string[]
  */
 public function getAllowedActions($workFlow, $state)
 {
     $accessFlowStateMachineService = new AccessFlowStateMachineService();
     $allowedActionsForInterviewer = $accessFlowStateMachineService->getAllowedActions($workFlow, $state, InterviewerUserRoleDecorator::INTERVIEWER);
     $existingAllowedActions = $this->user->getAllowedActions($workFlow, $state);
     if (is_null($allowedActionsForInterviewer)) {
         return $existingAllowedActions;
     } else {
         $allowedActionsList = array_unique(array_merge($allowedActionsForInterviewer, $existingAllowedActions));
         return $allowedActionsList;
     }
 }
コード例 #2
0
 public function getAllowedActions($workFlow, $state)
 {
     $accessFlowStateMachineService = new AccessFlowStateMachineService();
     $allowedActionsForSupervisorUser = $accessFlowStateMachineService->getAllowedActions($workFlow, $state, SupervisorUserRoleDecorator::SUPERVISOR_USER);
     $existingAllowedActions = $this->user->getAllowedActions($workFlow, $state);
     if (is_null($allowedActionsForSupervisorUser)) {
         return $existingAllowedActions;
     }
     $allowedActionsList = array_unique(array_merge($allowedActionsForSupervisorUser, $existingAllowedActions));
     return $allowedActionsList;
 }
コード例 #3
0
 /**
  * Get actions that this user can perform on a perticular workflow with the current state
  * @param int $workFlow
  * @param string $state
  * @return string[]
  */
 public function getAllowedActions($workFlow, $state)
 {
     $accessFlowStateMachineService = new AccessFlowStateMachineService();
     $allowedActionsForEssUser = $accessFlowStateMachineService->getAllowedActions($workFlow, $state, ProjectAdminUserRoleDecorator::PROJECT_ADMIN_USER);
     $existingAllowedActions = $this->user->getAllowedActions($workFlow, $state);
     if (is_null($allowedActionsForEssUser)) {
         return $existingAllowedActions;
     }
     $allowedActionsList = array_unique(array_merge($allowedActionsForEssUser, $existingAllowedActions));
     return $allowedActionsList;
 }
コード例 #4
0
 /**
  * Get actions that this user can perform on a perticular workflow with the current state
  * @param int $workFlow
  * @param string $state
  * @return string[]
  */
 public function getAllowedActions($workFlow, $state)
 {
     $accessFlowStateMachineService = new AccessFlowStateMachineService();
     $allowedActionsForAdminUser = $accessFlowStateMachineService->getAllowedActions($workFlow, $state, $this->getUserRoleName());
     $existingAllowedActions = $this->user->getAllowedActions($workFlow, $state);
     if (is_null($allowedActionsForAdminUser)) {
         return $existingAllowedActions;
     } else {
         $allowedActionsList = array_unique(array_merge($allowedActionsForAdminUser, $existingAllowedActions));
         return $allowedActionsList;
     }
 }
コード例 #5
0
 /**
  * Get allowed Actions for User
  * 
  * @param type $workflow
  * @param type $state
  * @return actionsArray 
  */
 public function getAllowedActions($workflow, $state)
 {
     $accessFlowStateMachineService = new AccessFlowStateMachineService();
     $allAction = array();
     foreach ($this->userRoles as $role) {
         $userAction = $accessFlowStateMachineService->getAllowedActions($workflow, $state, $role);
         if (count($userAction) > 0) {
             $allAction = array_unique(array_merge($allAction, $userAction));
         }
     }
     return $allAction;
 }