• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/access/rule/eventeditrule.php
  • Класс: BitrixCalendarAccessRuleEventEditRule
  • Вызов: EventEditRule::execute
public function execute(AccessibleItem $item = null, $params = null): bool
{
	if (!$item instanceof EventModel)
	{
		return false;
	}

	if (!$this->hasCurrentUser())
	{
		return true;
	}

	if ($this->user->isAdmin() || $this->user->isSocNetAdmin($item->getSectionType()))
	{
		return true;
	}

	if (isset($params['checkCurrentEvent']) && $params['checkCurrentEvent'] === 'Y')
	{
		$section = SectionModel::createFromEventModel($item);
	}
	else
	{
		$section = SectionModel::createFromEventModelParentFields($item);
	}

	return $this->controller->check(
		ActionDictionary::ACTION_SECTION_EDIT,
		$section,
	);
}