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