Server IP : 85.193.89.191 / Your IP : 3.133.156.208 Web Server : Apache System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : bitrix ( 600) PHP Version : 8.1.27 Disable Function : NONE MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/bitrix/www/bitrix/modules/bizproc/lib/Api/Service/ |
Upload File : |
<?php namespace Bitrix\Bizproc\Api\Service; use Bitrix\Bizproc\Api\Request\WorkflowAccessService\CheckStartWorkflowRequest; use Bitrix\Bizproc\Api\Response\Error; use Bitrix\Bizproc\Api\Response\WorkflowAccessService\CheckAccessResponse; use Bitrix\Main\Localization\Loc; class WorkflowAccessService { private const PREFIX_LOC_ID = 'BIZPROC_LIB_API_WORKFLOW_ACCESS_SERVICE_'; private const RIGHTS_ERROR = 'START_WORKFLOW_RIGHTS_ERROR'; public function checkStartWorkflow(CheckStartWorkflowRequest $request): CheckAccessResponse { $hasAccess = \CBPDocument::canUserOperateDocument( \CBPCanUserOperateOperation::StartWorkflow, $request->userId, $request->complexDocumentId, $request->parameters, ) ; $response = new CheckAccessResponse(); if (!$hasAccess) { $response->addError(new Error(Loc::getMessage(static::PREFIX_LOC_ID . static::RIGHTS_ERROR))); } return $response; } }