SectionAddRule::execute

  1. Bitrix24 API (v. 23.675.0)
  2. calendar
  3. SectionAddRule
  4. execute
  • Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/access/rule/sectionaddrule.php
  • Класс: BitrixCalendarAccessRuleSectionAddRule
  • Вызов: SectionAddRule::execute
public function execute(AccessibleItem $item = null, $params = null): bool
{
	if (!$item instanceof SectionModel)
	{
		return false;
	}

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

	if ($this->isOwner($item, $this->user->getUserId()))
	{
		return true;
	}
	elseif ($item->getType() === EventToolsDictionary::CALENDAR_TYPE['user'])
	{
		return false;
	}

	$type = TypeModel::createFromSectionModel($item);

	return
		$this->controller->check(
			ActionDictionary::ACTION_TYPE_EDIT,
			$type,
		);
}

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