1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
eventviewcommentsrule.php
См. документацию.
1<?php
2
3namespace Bitrix\Calendar\Access\Rule;
4
5use Bitrix\Calendar\Access\Model\EventModel;
6use Bitrix\Calendar\Access\Model\SectionModel;
7use Bitrix\Calendar\Access\Rule\Traits\CategoryTrait;
8use Bitrix\Calendar\Core\Event\Tools\Dictionary;
9use Bitrix\Main\Access\AccessibleItem;
10use Bitrix\Calendar\Access\ActionDictionary;
11use Bitrix\Calendar\Access\Rule\Traits\CurrentUserTrait;
12use Bitrix\Main\Loader;
13
15{
16 use CurrentUserTrait;
17 use CategoryTrait;
18
19 public function execute(AccessibleItem $item = null, $params = null): bool
20 {
21 if (!$item instanceof EventModel)
22 {
23 return false;
24 }
25
26 if (!Loader::includeModule('forum'))
27 {
28 return false;
29 }
30
31 if ($item->getEventType() === Dictionary::EVENT_TYPE['resource_booking'])
32 {
33 return false;
34 }
35
36 if ($this->user->isAdmin() || $this->user->isSocNetAdmin($item->getSectionType()))
37 {
38 return true;
39 }
40
41 if ($item->getSectionType() === Dictionary::CALENDAR_TYPE['open_event'])
42 {
43 return $this->checkCategoryByEvent($item);
44 }
45
46 $section = SectionModel::createFromEventModel($item);
47
48 return $this->controller->check(
50 $section,
51 );
52 }
53}
execute(AccessibleItem $item=null, $params=null)
Определения eventviewcommentsrule.php:19
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799