24 if(!$this->checkHasAccess($userId))
38 if(!$this->checkHasAccess($userId))
55 || $USER->canDoOperation(
'bitrix24_config')
68 private function checkHasAccess($userId)
72 if($this->hasAccess ===
null)
74 if (Loader::includeModule(
"bizproc"))
78 || $USER->canDoOperation(
'bitrix24_config')
81 $this->hasAccess =
true;
86 $workflowIntegerId = intval($this->
getId());
87 if ($workflowIntegerId > 0)
89 $workflowId = \CBPStateService::getWorkflowByIntegerId($workflowIntegerId);
94 $currentUserId = (int) $USER->getId();
95 $participants = \CBPTaskService::getWorkflowParticipants($workflowId);
96 if (in_array($currentUserId, $participants))
98 $this->hasAccess =
true;
102 $state = \CBPStateService::getWorkflowStateInfo($workflowId);
105 && $currentUserId === (int) $state[
'STARTED_BY']
111 $this->hasAccess =
false;
114 if (!$this->hasAccess && Loader::includeModule(
"iblock"))
116 $documentId = \CBPStateService::GetStateDocumentId($workflowId);
117 $elementQuery = \CIBlockElement::getList(
118 array(), array(
"ID" => $documentId[2]),
false,
false, array(
"IBLOCK_ID"));
119 $element = $elementQuery->fetch();
120 if ($element[
'IBLOCK_ID'])
122 $this->hasAccess = \CIBlockElementRights::userHasRightTo(
123 $element[
"IBLOCK_ID"], $documentId[2],
"element_read");
130 $this->hasAccess =
false;
134 return $this->hasAccess;