1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
sectionaccessrule.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 (!$this->hasCurrentUser())
27 {
28 return true;
29 }
30
31 if (!$this->canSeeOwnerIfExtranetUser($item, $this->user))
32 {
33 return false;
34 }
35
36 if ($this->user->isAdmin() || $this->user->isSocNetAdmin($item->getType()))
37 {
38 return true;
39 }
40
41 if ($this->isOwner($item, $this->user->getUserId()))
42 {
43 return true;
44 }
45
46 if ($item->getType() === Dictionary::CALENDAR_TYPE['open_event'])
47 {
48 return true;
49 }
50
51 $type = TypeModel::createFromSectionModel($item);
52 $typeCheck = true;
53
54 if ($item->getType() === Dictionary::CALENDAR_TYPE['group'])
55 {
56 $typeCheck = $this->controller->check(ActionDictionary::ACTION_TYPE_EDIT, $type);
57 }
58 else if ($item->getType() !== \Bitrix\Calendar\Core\Event\Tools\Dictionary::CALENDAR_TYPE['resource'])
59 {
60 $typeCheck = $this->controller->check(ActionDictionary::ACTION_TYPE_ACCESS, $type);
61 }
62
63 return
64 $typeCheck
65 && in_array(
67 CCalendarSect::GetOperations($item->getId(), $this->user->getUserId()),
68 true
69 );
70 }
71}
$type
Определения options.php:106
static getOldActionKeyByNewActionKey(string $actionId)
Определения actiondictionary.php:57
execute(AccessibleItem $item=null, $params=null)
Определения sectionaccessrule.php:19
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799