Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
sectionaddrule.php
1<?php
2
4
7use Bitrix\Calendar\Access\Rule\Traits\CurrentUserTrait;
8use Bitrix\Calendar\Access\Rule\Traits\ExtranetUserTrait;
11use Bitrix\Calendar\Access\Rule\Traits\SectionTrait;
13
15{
16 use SectionTrait, CurrentUserTrait, ExtranetUserTrait;
17
18 public function execute(AccessibleItem $item = null, $params = null): bool
19 {
20 if (!$item instanceof SectionModel)
21 {
22 return false;
23 }
24
25 if (!$this->hasCurrentUser())
26 {
27 return true;
28 }
29
30 if (!$this->canSeeOwnerIfExtranetUser($item, $this->user))
31 {
32 return false;
33 }
34
35 if ($item->getType() === Event\Tools\Dictionary::CALENDAR_TYPE['user'])
36 {
37 return $this->isOwner($item, $this->user->getUserId());
38 }
39
40 $type = TypeModel::createFromSectionModel($item);
41
42 return
43 $this->controller->check(
45 $type,
46 );
47 }
48}
execute(AccessibleItem $item=null, $params=null)