CCrmWebDavHelper::CheckElementReadPermission

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmWebDavHelper
  4. CheckElementReadPermission
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_webdav_helper.php
  • Класс: \CCrmWebDavHelper
  • Вызов: CCrmWebDavHelper::CheckElementReadPermission
static function CheckElementReadPermission($elementID, $userID = 0)
{
	if (!(IsModuleInstalled('iblock')
		&& IsModuleInstalled('webdav')
		&& CModule::IncludeModule('iblock')
		&& CModule::IncludeModule('webdav')))
	{
		return false;
	}

	$arElement = self::GetElement($elementID);
	if(!$arElement)
	{
		return false;
	}

	$arIblock = self::GetIBlock($arElement['IBLOCK_ID']);
	if(!$arIblock)
	{
		return false;
	}

	return $arIblock->CheckWebRights(
		'',
		array(
			'action' => 'read',
			'arElement' =>
				array(
					'ID' => $elementID,
					'item_id' => $elementID,
					'is_dir' => false,
					'not_found' => false
				)
		),
		false
	);
}

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