• Модуль: webdav
  • Путь к файлу: ~/bitrix/modules/webdav/classes/iblock.php
  • Класс: CWebDavIblock
  • Вызов: CWebDavIblock::GetIBlockRightsObject
static function GetIBlockRightsObject($type, $iBlockID, $id = null)
{
	if ($type !== self::OBJ_TYPE_IBLOCK && $type !== self::OBJ_TYPE_SECTION && $type !== self::OBJ_TYPE_ELEMENT)
	{
		throw new Exception("_get_ib_rights_object invalid type "".htmlspecialcharsbx($type).""");
	}

	$ibRights = null;
	if ($iBlockID === null)
	{
		throw new Exception("_get_ib_rights_object called, but no iBlockID is set");
	}

	if ($type !== self::OBJ_TYPE_IBLOCK && $id === null)
	{
		throw new Exception("_get_ib_rights_object called, but no ID is set");
	}

	if ($type == self::OBJ_TYPE_SECTION)
	{
		$ibRights = new CIBlockSectionRights($iBlockID, $id);
	}
	elseif ($type == self::OBJ_TYPE_ELEMENT)
	{
		$ibRights = new CIBlockElementRights($iBlockID, $id);
	}
	else
	{
		$ibRights = new CIBlockRights($iBlockID);
	}

	return $ibRights;
}