Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
BaseIblockRule.php
1<?php
2
4
11
13{
14 /* @var AccessController $controller */
15 /* @var UserModel $user */
16
24 public function execute(AccessibleItem $item = null, $params = null): bool
25 {
26 if ($this->user->isAdmin())
27 {
28 return true;
29 }
30
31 return $this->check($params);
32 }
33
41 protected function check($params): bool
42 {
43 $groups = $this->user->getRightGroups();
44
45 $groupData = GroupTable::getList([
46 'filter' => ['STRING_ID' => $this->getShopIblockTypes()],
47 'select' => ['ID']
48 ])
49 ->fetchAll()
50 ;
51
52 $shopGroupIds = array_column($groupData, 'ID');
53 if (!$shopGroupIds)
54 {
55 return false;
56 }
57
58 return !empty(array_intersect($groups, $shopGroupIds));
59 }
60
68}
execute(AccessibleItem $item=null, $params=null)
static getList(array $parameters=array())