Rights::hasAccessForLanding

  1. Bitrix24 API (v. 23.675.0)
  2. landing
  3. Rights
  4. hasAccessForLanding
  • Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/rights.php
  • Класс: BitrixLandingRights
  • Вызов: Rights::hasAccessForLanding
static function hasAccessForLanding($landingId, $accessType)
{
	static $operations = [];
	$landingId = intval($landingId);

	if (!is_string($accessType))
	{
		return false;
	}

	if (!isset($operations[$landingId]))
	{
		$site = Landing::getList([
 				'select' => [
				'SITE_ID'
			],
			'filter' => [
				'ID' => $landingId,
				'=SITE.DELETED' => ['Y', 'N'],
				'=DELETED' => ['Y', 'N']
			]
		])->fetch();

		if ($site)
		{
			$operations[$landingId] = self::getOperations(
				$site['SITE_ID'],
				self::ENTITY_TYPE_SITE
			);
		}
		else
		{
			$operations[$landingId] = [];
		}
	}

	return in_array($accessType, $operations[$landingId]);
}

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