Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
eventviewtitlerule.php
1
<?php
2
3
namespace
Bitrix\Calendar\Access\Rule
;
4
5
use
Bitrix\Calendar\Access\Model\EventModel
;
6
use
Bitrix\Calendar\Access\Model\SectionModel
;
7
use
Bitrix\Main\Access\AccessibleItem
;
8
use
Bitrix\Calendar\Access\ActionDictionary
;
9
use Bitrix\Calendar\Access\Rule\Traits\CurrentUserTrait;
10
11
class
EventViewTitleRule
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
EventModel
)
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->getSectionType()))
28
{
29
return
true
;
30
}
31
32
$section = SectionModel::createFromEventModel($item);
33
34
return
$this->controller->check(
35
ActionDictionary::ACTION_SECTION_EVENT_VIEW_TITLE
,
36
$section,
37
);
38
}
39
}
Bitrix\Calendar\Access\ActionDictionary
Definition
actiondictionary.php:6
Bitrix\Calendar\Access\ActionDictionary\ACTION_SECTION_EVENT_VIEW_TITLE
const ACTION_SECTION_EVENT_VIEW_TITLE
Definition
actiondictionary.php:14
Bitrix\Calendar\Access\Model\EventModel
Definition
eventmodel.php:11
Bitrix\Calendar\Access\Model\SectionModel
Definition
sectionmodel.php:9
Bitrix\Calendar\Access\Rule\EventViewTitleRule
Definition
eventviewtitlerule.php:12
Bitrix\Calendar\Access\Rule\EventViewTitleRule\execute
execute(AccessibleItem $item=null, $params=null)
Definition
eventviewtitlerule.php:15
Bitrix\Main\Access\Rule\AbstractRule
Definition
abstractrule.php:16
Bitrix\Main\Access\AccessibleItem
Definition
accessibleitem.php:13
Bitrix\Calendar\Access\Rule
Definition
eventaddrule.php:3
modules
calendar
lib
access
rule
eventviewtitlerule.php
Создано системой
1.10.0