Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
checkwritepermission.php
1<?php
2
3declare(strict_types = 1);
4
6
8
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}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29