Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
eventviewcommentsrule.php
1<?php
2
4
10use Bitrix\Calendar\Access\Rule\Traits\CurrentUserTrait;
12
14{
15 use CurrentUserTrait;
16
17 public function execute(AccessibleItem $item = null, $params = null): bool
18 {
19 if (!$item instanceof EventModel)
20 {
21 return false;
22 }
23
24 if (!Loader::includeModule('forum'))
25 {
26 return false;
27 }
28
29 if ($item->getEventType() === Dictionary::EVENT_TYPE['resource_booking'])
30 {
31 return false;
32 }
33
34 if ($this->user->isAdmin() || $this->user->isSocNetAdmin($item->getSectionType()))
35 {
36 return true;
37 }
38
39 $section = SectionModel::createFromEventModel($item);
40
41 return $this->controller->check(
43 $section,
44 );
45 }
46}
execute(AccessibleItem $item=null, $params=null)