1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
sectioneventviewtimerule.php
См. документацию.
1<?php
2
3namespace Bitrix\Calendar\Access\Rule;
4
5use Bitrix\Calendar\Access\Model\SectionModel;
6use Bitrix\Calendar\Access\Model\TypeModel;
7use Bitrix\Calendar\Access\Rule\Traits\ExtranetUserTrait;
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\Calendar\Access\Rule\Traits\SectionTrait;
13use CCalendarSect;
14
16{
17 use SectionTrait, CurrentUserTrait, ExtranetUserTrait;
18
19 public function execute(AccessibleItem $item = null, $params = null): bool
20 {
21 if (!$item instanceof SectionModel)
22 {
23 return false;
24 }
25
26 if ($item->getType() === Dictionary::CALENDAR_TYPE['open_event'])
27 {
28 return true;
29 }
30
31 if (!$this->hasCurrentUser())
32 {
33 return true;
34 }
35
36 if (!$this->canSeeOwnerIfExtranetUser($item, $this->user))
37 {
38 return false;
39 }
40
41 if ($this->user->isAdmin() || $this->user->isSocNetAdmin($item->getType()))
42 {
43 return true;
44 }
45
46 if ($this->isOwner($item, $this->user->getUserId()) || $this->isManager($item, $this->user->getUserId()))
47 {
48 return true;
49 }
50
51 $type = TypeModel::createFromSectionModel($item);
52 $typeCheck = true;
53
54 if ($item->getType() !== \Bitrix\Calendar\Core\Event\Tools\Dictionary::CALENDAR_TYPE['resource'])
55 {
56 $typeCheck = $this->controller->check(ActionDictionary::ACTION_TYPE_VIEW, $type);
57 }
58
59 return
60 $typeCheck
61 && in_array(
63 CCalendarSect::GetOperations($item->getId(), $this->user->getUserId()),
64 true
65 );
66 }
67}
$type
Определения options.php:106
static getOldActionKeyByNewActionKey(string $actionId)
Определения actiondictionary.php:57
execute(AccessibleItem $item=null, $params=null)
Определения sectioneventviewtimerule.php:19
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799