Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
WorkflowAccessService.php
1
<?php
2
3
namespace
Bitrix\Bizproc\Api\Service
;
4
5
use
Bitrix\Bizproc\Api\Request\WorkflowAccessService\CheckStartWorkflowRequest
;
6
use
Bitrix\Bizproc\Api\Response\Error
;
7
use
Bitrix\Bizproc\Api\Response\WorkflowAccessService\CheckAccessResponse
;
8
use
Bitrix\Main\Localization\Loc
;
9
10
class
WorkflowAccessService
11
{
12
private
const
PREFIX_LOC_ID =
'BIZPROC_LIB_API_WORKFLOW_ACCESS_SERVICE_'
;
13
private
const
RIGHTS_ERROR =
'START_WORKFLOW_RIGHTS_ERROR'
;
14
15
public
function
checkStartWorkflow
(
CheckStartWorkflowRequest
$request):
CheckAccessResponse
16
{
17
$hasAccess =
18
\CBPDocument::canUserOperateDocument(
19
\CBPCanUserOperateOperation::StartWorkflow,
20
$request->userId,
21
$request->complexDocumentId,
22
$request->parameters,
23
)
24
;
25
26
$response =
new
CheckAccessResponse
();
27
if
(!$hasAccess)
28
{
29
$response->addError(
new
Error
(
Loc::getMessage
(static::PREFIX_LOC_ID . static::RIGHTS_ERROR)));
30
}
31
32
return
$response;
33
}
34
}
Bitrix\Bizproc\Api\Request\WorkflowAccessService\CheckStartWorkflowRequest
Definition
CheckStartWorkflowRequest.php:6
Bitrix\Bizproc\Api\Response\Error
Definition
Error.php:8
Bitrix\Bizproc\Api\Response\WorkflowAccessService\CheckAccessResponse
Definition
CheckAccessResponse.php:8
Bitrix\Bizproc\Api\Service\WorkflowAccessService
Definition
WorkflowAccessService.php:11
Bitrix\Bizproc\Api\Service\WorkflowAccessService\checkStartWorkflow
checkStartWorkflow(CheckStartWorkflowRequest $request)
Definition
WorkflowAccessService.php:15
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Bizproc\Api\Service
Definition
TaskAccessService.php:3
modules
bizproc
lib
Api
Service
WorkflowAccessService.php
Создано системой
1.10.0