Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
checkwritepermission.php
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace
Bitrix\Sale\Controller\Engine\ActionFilter
;
6
7
use
Bitrix\Main
;
8
9
class
CheckWritePermission
extends
Main\Engine\ActionFilter\Base
10
{
11
public
function
onBeforeAction
(Main\
Event
$event): ?Main\
EventResult
12
{
13
if
(!$this->
hasPermission
())
14
{
15
$this->
addError
(
new
Main\
Error
(
16
Main\Localization\
Loc::getMessage
(
'SALE_CONTROLLER_ENGINE_ACTIONFILTER_CHECK_WRITE_PERMISSION'
)
17
));
18
19
return
new
Main\EventResult
(Main\EventResult::ERROR,
null
,
null
, $this);
20
}
21
22
return
null
;
23
}
24
25
protected
function
hasPermission
(): bool
26
{
27
global $APPLICATION;
28
$saleModulePermissions = $APPLICATION->GetGroupRight(
'sale'
);
29
30
return
$saleModulePermissions >=
'W'
;
31
}
32
}
Bitrix\Main\Engine\ActionFilter\Base
Definition
base.php:15
Bitrix\Main\Engine\ActionFilter\Base\addError
addError(Error $error)
Definition
base.php:80
Bitrix\Main\Error
Definition
error.php:14
Bitrix\Main\Event
Definition
event.php:5
Bitrix\Main\EventResult
Definition
eventresult.php:5
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Sale\Controller\Engine\ActionFilter\CheckWritePermission
Definition
checkwritepermission.php:10
Bitrix\Sale\Controller\Engine\ActionFilter\CheckWritePermission\hasPermission
hasPermission()
Definition
checkwritepermission.php:25
Bitrix\Sale\Controller\Engine\ActionFilter\CheckWritePermission\onBeforeAction
onBeforeAction(Main\Event $event)
Definition
checkwritepermission.php:11
Bitrix\Main
Bitrix\Sale\Controller\Engine\ActionFilter
Definition
checkwritepermission.php:5
modules
sale
lib
controller
engine
actionfilter
checkwritepermission.php
Создано системой
1.10.0