Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
eventdeleterule.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\Calendar\Access\Rule\Traits\SharingTrait;
8
use
Bitrix\Calendar\Sharing\SharingEventManager
;
9
use
Bitrix\Main\Access\AccessibleItem
;
10
use
Bitrix\Calendar\Access\ActionDictionary
;
11
use Bitrix\Calendar\Access\Rule\Traits\CurrentUserTrait;
12
13
class
EventDeleteRule
extends
\Bitrix\Main\Access\Rule\AbstractRule
14
{
15
use CurrentUserTrait;
16
use SharingTrait;
17
18
public
function
execute
(
AccessibleItem
$item =
null
, $params =
null
): bool
19
{
20
if
(!$item instanceof
EventModel
)
21
{
22
return
false
;
23
}
24
25
if
(!$this->hasCurrentUser())
26
{
27
return
true
;
28
}
29
30
if
($this->user->isAdmin() || $this->user->isSocNetAdmin($item->getSectionType()))
31
{
32
return
true
;
33
}
34
35
return
$this->controller->check(
36
ActionDictionary::ACTION_EVENT_EDIT
,
37
$item,
38
);
39
}
40
}
Bitrix\Calendar\Access\ActionDictionary
Definition
actiondictionary.php:6
Bitrix\Calendar\Access\ActionDictionary\ACTION_EVENT_EDIT
const ACTION_EVENT_EDIT
Definition
actiondictionary.php:17
Bitrix\Calendar\Access\Model\EventModel
Definition
eventmodel.php:11
Bitrix\Calendar\Access\Model\SectionModel
Definition
sectionmodel.php:9
Bitrix\Calendar\Access\Rule\EventDeleteRule
Definition
eventdeleterule.php:14
Bitrix\Calendar\Access\Rule\EventDeleteRule\execute
execute(AccessibleItem $item=null, $params=null)
Definition
eventdeleterule.php:18
Bitrix\Calendar\Sharing\SharingEventManager
Definition
sharingeventmanager.php:25
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
eventdeleterule.php
Создано системой
1.10.0