Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
sectioneventviewcommentsrule.php
1<?php
2
4
7use Bitrix\Calendar\Access\Rule\Traits\ExtranetUserTrait;
10use Bitrix\Calendar\Access\Rule\Traits\CurrentUserTrait;
11use Bitrix\Calendar\Access\Rule\Traits\SectionTrait;
12use CCalendarSect;
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 ($this->user->isAdmin() || $this->user->isSocNetAdmin($item->getType()))
36 {
37 return true;
38 }
39
40 if ($this->isOwner($item, $this->user->getUserId()))
41 {
42 return true;
43 }
44
45 $type = TypeModel::createFromSectionModel($item);
46
47 return
48 $this->controller->check(
50 $type,
51 )
52 && in_array(
54 CCalendarSect::GetOperations($item->getId(), $this->user->getUserId()),
55 true
56 );
57 }
58}
static getOldActionKeyByNewActionKey(string $actionId)