Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
StoreDocumentPerformRule.php
1
<?php
2
3
namespace
Bitrix\Catalog\Access\Rule
;
4
5
use
Bitrix\Catalog\Access\ActionDictionary
;
6
use
Bitrix\Catalog\Access\Model\StoreDocument
;
7
use
Bitrix\Catalog\Access\Permission\PermissionDictionary
;
8
9
class
StoreDocumentPerformRule
extends
BaseRule
10
{
16
protected
static
function
getPermissionCode
(array $params): ?string
17
{
18
$docCode = $params[
'value'
] ??
null
;
19
$docItem = $params[
'item'
] ??
null
;
20
21
if
($docItem instanceof
StoreDocument
)
22
{
23
$docCode = $docItem->getType();
24
}
25
26
if
(!$docCode || !in_array($docCode, PermissionDictionary::getAvailableStoreDocuments(),
true
))
27
{
28
return
null
;
29
}
30
31
$permissionId = (string)
ActionDictionary::getStoreDocumentActionPermissionMap
()[$params[
'action'
]];
32
if
(!$permissionId)
33
{
34
return
null
;
35
}
36
37
return
PermissionDictionary::getStoreDocumentPermissionId($permissionId, $docCode);
38
}
39
}
Bitrix\Catalog\Access\ActionDictionary
Definition
ActionDictionary.php:17
Bitrix\Catalog\Access\ActionDictionary\getStoreDocumentActionPermissionMap
static getStoreDocumentActionPermissionMap()
Definition
ActionDictionary.php:173
Bitrix\Catalog\Access\Model\StoreDocument
Definition
StoreDocument.php:9
Bitrix\Catalog\Access\Permission\PermissionDictionary
Definition
PermissionDictionary.php:21
Bitrix\Catalog\Access\Rule\BaseRule
Definition
BaseRule.php:13
Bitrix\Catalog\Access\Rule\StoreDocumentPerformRule
Definition
StoreDocumentPerformRule.php:10
Bitrix\Catalog\Access\Rule\StoreDocumentPerformRule\getPermissionCode
static getPermissionCode(array $params)
Definition
StoreDocumentPerformRule.php:16
Bitrix\Catalog\Access\Rule
Definition
BaseRule.php:3
modules
catalog
lib
Access
Rule
StoreDocumentPerformRule.php
Создано системой
1.10.0