EventAddRule::execute

  1. Bitrix24 API (v. 23.675.0)
  2. calendar
  3. EventAddRule
  4. execute
  • Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/access/rule/eventaddrule.php
  • Класс: BitrixCalendarAccessRuleEventAddRule
  • Вызов: EventAddRule::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;
	}

	$section = SectionModel::createFromEventModel($item);

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

Добавить комментарий