Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/calendar/lib/access/rule/ |
Upload File : |
<?php namespace Bitrix\Calendar\Access\Rule; use Bitrix\Calendar\Access\Model\SectionModel; use Bitrix\Calendar\Access\Model\TypeModel; use Bitrix\Calendar\Access\Rule\Traits\ExtranetUserTrait; use Bitrix\Calendar\Core\Event\Tools\Dictionary; use Bitrix\Main\Access\AccessibleItem; use Bitrix\Calendar\Access\ActionDictionary; use Bitrix\Calendar\Access\Rule\Traits\CurrentUserTrait; use Bitrix\Calendar\Access\Rule\Traits\SectionTrait; use CCalendarSect; class SectionAccessRule extends \Bitrix\Main\Access\Rule\AbstractRule { use SectionTrait, CurrentUserTrait, ExtranetUserTrait; public function execute(AccessibleItem $item = null, $params = null): bool { if (!$item instanceof SectionModel) { return false; } if (!$this->hasCurrentUser()) { return true; } if (!$this->canSeeOwnerIfExtranetUser($item, $this->user)) { return false; } if ($this->user->isAdmin() || $this->user->isSocNetAdmin($item->getType())) { return true; } if ($this->isOwner($item, $this->user->getUserId())) { return true; } if ($item->getType() === Dictionary::CALENDAR_TYPE['open_event']) { return true; } $type = TypeModel::createFromSectionModel($item); $typeCheck = true; if ($item->getType() === Dictionary::CALENDAR_TYPE['group']) { $typeCheck = $this->controller->check(ActionDictionary::ACTION_TYPE_EDIT, $type); } else if ($item->getType() !== \Bitrix\Calendar\Core\Event\Tools\Dictionary::CALENDAR_TYPE['resource']) { $typeCheck = $this->controller->check(ActionDictionary::ACTION_TYPE_ACCESS, $type); } return $typeCheck && in_array( ActionDictionary::getOldActionKeyByNewActionKey(ActionDictionary::ACTION_SECTION_ACCESS), CCalendarSect::GetOperations($item->getId(), $this->user->getUserId()), true ); } }