• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/rights.php
  • Класс: BitrixLandingRights
  • Вызов: Rights::hasExtraRights
static function hasExtraRights(): bool
{
	// has context user access to crm forms
	if (BitrixMainLoader::includeModule('crm'))
	{
		$access = new CCrmPerms(self::getContextUserId());
		if (!$access->havePerm('WEBFORM', BX_CRM_PERM_NONE, 'WRITE'))
		{
			// grant access to crm forms sites
			$res = Site::getList([
				'select' => [
					'ID'
				],
				'filter' => [
					'CODE' => '/' . SiteType::PSEUDO_SCOPE_CODE_FORMS . '%',
					'=SPECIAL' => 'Y',
					'CHECK_PERMISSIONS' => 'N'
				]
			]);
			while ($row = $res->fetch())
			{
				self::$allowedSites[] = $row['ID'];
			}

			return true;
		}
	}
	return false;
}