1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
sectioneditrule.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;
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 ($item->getType() === Dictionary::CALENDAR_TYPE['open_event'])
41 {
42 return false;
43 }
44
45 if ($this->isOwner($item, $this->user->getUserId()))
46 {
47 return true;
48 }
49
50 $type = TypeModel::createFromSectionModel($item);
51 $typeCheck = true;
52
53 if ($item->getType() !== \Bitrix\Calendar\Core\Event\Tools\Dictionary::CALENDAR_TYPE['resource'])
54 {
55 $typeCheck = $this->controller->check(ActionDictionary::ACTION_TYPE_EDIT, $type);
56 }
57
58 return
59 $typeCheck
60 && in_array(
62 \CCalendarSect::GetOperations($item->getId(), $this->user->getUserId()),
63 true
64 );
65 }
66}
$type
Определения options.php:106
static getOldActionKeyByNewActionKey(string $actionId)
Определения actiondictionary.php:57
execute(AccessibleItem $item=null, $params=null)
Определения sectioneditrule.php:18
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799