39 $this->_authorizedContext = $authorizedContext;
49 return isset($this->_authorizedContext[$assocType])?$this->_authorizedContext[$assocType]:
null;
59 if ($this->
hasStageRole($query->getStageId(), array(ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR)))
return true;
62 if ($this->
hasStageRole($query->getStageId(), array(ROLE_ID_ASSISTANT)) && $this->
isAssigned($this->_user->getId(), $query->getId()))
return true;
74 return $this->
hasStageRole($stageId, array(ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR));
83 return $this->
hasStageRole($stageId, array(ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR, ROLE_ID_ASSISTANT, ROLE_ID_AUTHOR, ROLE_ID_REVIEWER));
93 $query = $queryDao->getById($queryId);
94 if (!$query)
return false;
97 if ($this->
hasStageRole($query->getStageId(), array(ROLE_ID_ASSISTANT, ROLE_ID_AUTHOR, ROLE_ID_REVIEWER))) {
98 if ($query->getHeadNote()->getUserId() == $this->_user->getId())
return true;
102 if ($this->
hasStageRole($query->getStageId(), array(ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR)))
return true;
116 $query = $queryDao->getById($queryId);
118 $headNote = $query->getHeadNote();
119 if ($headNote->getUserId() == $this->_user->getId() && $headNote->getTitle()==
'')
return true;
123 if ($this->
hasStageRole($query->getStageId(), array(ROLE_ID_MANAGER)))
return true;
136 return $this->
hasStageRole($stageId, array(ROLE_ID_MANAGER));
145 protected function isAssigned($userId, $queryId) {
147 return (
boolean) $queryDao->getParticipantIds($queryId, $userId);
159 return !empty(array_intersect($stageRoles[$stageId], $roles));