Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
userfieldviewrule.php
1
<?php
2
3
namespace
Bitrix\Main\UserField\Access\Rule
;
4
5
use
Bitrix\Main\Access\AccessibleController
;
6
use
Bitrix\Main\Access\AccessibleItem
;
7
use
Bitrix\Main\UserField\Access\Model\UserFieldModel
;
8
use
Bitrix\Main\UserField\Access\Permission\PermissionDictionary
;
9
10
class
UserFieldViewRule
11
extends
\Bitrix\Main\Access\Rule\AbstractRule
12
{
13
private
14
$userFieldModel =
null
;
15
16
public
function
__construct
(
AccessibleController
$controller
)
17
{
18
parent::__construct(
$controller
);
19
$this->userFieldModel =
UserFieldModel::createNew
();
20
}
21
22
public
function
execute
(
AccessibleItem
$userField =
null
, $params =
null
): bool
23
{
24
return
true
;
25
}
26
27
public
function
executeMass($userFields =
null
, $params =
null
): array
28
{
29
if
(!$userFields)
30
{
31
return
[];
32
}
33
34
if
($this->user->isAdmin())
35
{
36
return
[];
37
}
38
42
return
$this->userFieldModel->getPermissions(
43
$this->user,
44
PermissionDictionary::USER_FIELD_VIEW
45
);
46
}
47
}
Bitrix\Main\Access\Rule\AbstractRule
Definition
abstractrule.php:16
Bitrix\Main\Access\Rule\AbstractRule\$controller
$controller
Definition
abstractrule.php:18
Bitrix\Main\UserField\Access\Model\UserFieldModel
Definition
userfieldmodel.php:10
Bitrix\Main\UserField\Access\Model\UserFieldModel\createNew
static createNew()
Definition
userfieldmodel.php:14
Bitrix\Main\UserField\Access\Permission\PermissionDictionary
Definition
permissiondictionary.php:6
Bitrix\Main\UserField\Access\Permission\PermissionDictionary\USER_FIELD_VIEW
const USER_FIELD_VIEW
Definition
permissiondictionary.php:8
Bitrix\Main\UserField\Access\Rule\UserFieldViewRule
Definition
userfieldviewrule.php:12
Bitrix\Main\UserField\Access\Rule\UserFieldViewRule\execute
execute(AccessibleItem $userField=null, $params=null)
Definition
userfieldviewrule.php:22
Bitrix\Main\UserField\Access\Rule\UserFieldViewRule\__construct
__construct(AccessibleController $controller)
Definition
userfieldviewrule.php:16
Bitrix\Main\Access\AccessibleController
Definition
accessiblecontroller.php:15
Bitrix\Main\Access\AccessibleItem
Definition
accessibleitem.php:13
Bitrix\Main\UserField\Access\Rule
Definition
userfieldviewrule.php:3
modules
main
lib
userfield
access
rule
userfieldviewrule.php
Создано системой
1.10.0