Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
baserule.php
1
<?php
2
3
namespace
Bitrix\Sender\Access\Rule
;
4
5
use
Bitrix\Main\Access\AccessibleItem
;
6
use
Bitrix\Main\Access\Rule\AbstractRule
;
7
use
Bitrix\Main\Loader
;
8
use
Bitrix\Sender\Access\ActionDictionary
;
9
use
Bitrix\Sender\Access\Role\RoleUtil
;
10
use
Bitrix\Sender\Integration\Bitrix24\Service
;
11
use
Bitrix\Sender\Security\User
;
12
13
class
BaseRule
extends
AbstractRule
14
{
22
public
function
execute
(
AccessibleItem
$item =
null
, $params =
null
): bool
23
{
24
if
($this->user->isAdmin())
25
{
26
return
true
;
27
}
28
$user
=
User::get
($this->user->getUserId());
29
30
if
(
$user
->isExtranet())
31
{
32
return
false
;
33
}
34
35
$action =
ActionDictionary::getActionPermissionMap
()[$params[
'action'
]];
36
if
(
Service::isCloud
() && !
Service::isPermissionEnabled
())
37
{
38
return
$user
->isPortalAdmin() || in_array($action, RoleUtil::preparedRoleMap()[
'MANAGER'
]);
39
}
40
41
if
($this->user->getPermission($action))
42
{
43
return
true
;
44
}
45
46
return
false
;
47
}
48
}
Bitrix\Main\Access\Rule\AbstractRule
Definition
abstractrule.php:16
Bitrix\Main\Access\Rule\AbstractRule\$user
$user
Definition
abstractrule.php:21
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Sender\Access\ActionDictionary
Definition
actiondictionary.php:18
Bitrix\Sender\Access\ActionDictionary\getActionPermissionMap
static getActionPermissionMap()
Definition
actiondictionary.php:77
Bitrix\Sender\Access\Role\RoleUtil
Definition
roleutil.php:20
Bitrix\Sender\Access\Rule\BaseRule
Definition
baserule.php:14
Bitrix\Sender\Access\Rule\BaseRule\execute
execute(AccessibleItem $item=null, $params=null)
Definition
baserule.php:22
Bitrix\Sender\Integration\Bitrix24\Service
Definition
service.php:30
Bitrix\Sender\Integration\Bitrix24\Service\isCloud
static isCloud()
Definition
service.php:308
Bitrix\Sender\Integration\Bitrix24\Service\isPermissionEnabled
static isPermissionEnabled()
Definition
service.php:108
Bitrix\Sender\Security\User
Definition
user.php:24
Bitrix\Sender\Security\User\get
static get($id)
Definition
user.php:62
Bitrix\Main\Access\AccessibleItem
Definition
accessibleitem.php:13
Bitrix\Sender\Access\Rule
Definition
baserule.php:3
modules
sender
lib
access
rule
baserule.php
Создано системой
1.10.0