1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
typeviewrule.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Calendar\Access\Rule;
4
5
use Bitrix\Calendar\Access\Model\TypeModel;
6
use Bitrix\Main\Access\AccessibleItem;
7
use Bitrix\Calendar\Access\ActionDictionary;
8
use Bitrix\Calendar\Access\Rule\Traits\CurrentUserTrait;
9
use CCalendarType;
10
11
class
TypeViewRule
extends
\Bitrix\Main\Access\Rule\AbstractRule
12
{
13
use CurrentUserTrait;
14
15
public
function
execute
(
AccessibleItem
$item =
null
,
$params
=
null
): bool
16
{
17
if
(!$item instanceof
TypeModel
)
18
{
19
return
false
;
20
}
21
22
if
(!$this->hasCurrentUser())
23
{
24
return
true
;
25
}
26
27
if
($this->user->isAdmin() || $this->user->isSocNetAdmin($item->getXmlId()))
28
{
29
return
true
;
30
}
31
32
return
in_array(
33
ActionDictionary::getOldActionKeyByNewActionKey
(
ActionDictionary::ACTION_TYPE_VIEW
),
34
CCalendarType::GetOperations($item->getXmlId(), $this->user->getUserId()),
35
true
36
);
37
}
38
}
Bitrix\Calendar\Access\ActionDictionary\getOldActionKeyByNewActionKey
static getOldActionKeyByNewActionKey(string $actionId)
Определения
actiondictionary.php:57
Bitrix\Calendar\Access\ActionDictionary\ACTION_TYPE_VIEW
const ACTION_TYPE_VIEW
Определения
actiondictionary.php:28
Bitrix\Calendar\Access\Model\TypeModel
Определения
typemodel.php:9
Bitrix\Calendar\Access\Rule\TypeViewRule
Определения
typeviewrule.php:12
Bitrix\Calendar\Access\Rule\TypeViewRule\execute
execute(AccessibleItem $item=null, $params=null)
Определения
typeviewrule.php:15
Bitrix\Main\Access\Rule\AbstractRule
Определения
abstractrule.php:16
Bitrix\Main\Access\AccessibleItem
Определения
accessibleitem.php:13
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
bitrix
modules
calendar
lib
access
rule
typeviewrule.php
Создано системой
1.14.0