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

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

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

	if ($this->isOwner($item, $this->user->getUserId()))
	{
		return true;
	}

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

	return
		$this->controller->check(
			ActionDictionary::ACTION_TYPE_VIEW,
			$type,
		)
		&& in_array(
			ActionDictionary::getOldActionKeyByNewActionKey(ActionDictionary::ACTION_SECTION_EVENT_VIEW_FULL),
			CCalendarSect::GetOperations($item->getId(), $this->user->getUserId()),
			true
		);
}