1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
eventeditlocationrule.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\Core\Event\Tools\Dictionary;
8use Bitrix\Calendar\Util;
9use Bitrix\Main\Access\AccessibleItem;
10use Bitrix\Calendar\Access\ActionDictionary;
11use Bitrix\Calendar\Access\Rule\Traits\CurrentUserTrait;
12
14{
15 use CurrentUserTrait;
16
17 public function execute(AccessibleItem $item = null, $params = null): bool
18 {
19 if (!$item instanceof EventModel)
20 {
21 return false;
22 }
23
24 if (!$this->hasCurrentUser())
25 {
26 return true;
27 }
28
29 if ($this->user->isAdmin() || $this->user->isSocNetAdmin($item->getSectionType()))
30 {
31 return true;
32 }
33
34 if ($item->getSectionType() === Dictionary::CALENDAR_TYPE['open_event'])
35 {
36 return $this->user->getUserId() === $item->getCreatedBy();
37 }
38
39 if ($item->getOwnerId() !== $this->user->getUserId())
40 {
41 return false;
42 }
43
44 if (Util::isCollabUser($this->user->getUserId()))
45 {
46 return false;
47 }
48
49 $section = SectionModel::createFromEventModel($item);
50
51 return $this->controller->check(
53 $section,
54 );
55 }
56}
execute(AccessibleItem $item=null, $params=null)
Определения eventeditlocationrule.php:17
static isCollabUser(int $userId)
Определения util.php:337
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799