1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
eventeditattendeesrule.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 // for open events no one can edit attendees
25 // users attend open events by self
26 if ($item->getSectionType() === Dictionary::CALENDAR_TYPE['open_event'])
27 {
28 return false;
29 }
30
31 if (!$this->hasCurrentUser())
32 {
33 return true;
34 }
35
36 if ($this->user->isAdmin() || $this->user->isSocNetAdmin($item->getSectionType()))
37 {
38 return true;
39 }
40
41 if ($item->getOwnerId() !== $this->user->getUserId())
42 {
43 return false;
44 }
45
46 if (Util::isCollabUser($this->user->getUserId()))
47 {
48 return false;
49 }
50
51 $section = SectionModel::createFromEventModel($item);
52
53 return $this->controller->check(
55 $section,
56 );
57 }
58}
execute(AccessibleItem $item=null, $params=null)
Определения eventeditattendeesrule.php:17
static isCollabUser(int $userId)
Определения util.php:337
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799