TypeEditRule::execute

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

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

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

	return in_array(
		ActionDictionary::getOldActionKeyByNewActionKey(ActionDictionary::ACTION_TYPE_EDIT),
		CCalendarType::GetOperations($item->getXmlId(), $this->user->getUserId()),
		true
	);
}

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