• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/rest/service/baseobject.php
  • Класс: BitrixDiskRestServiceBaseObject
  • Вызов: BaseObject::getWorkObjectById
protected function getWorkObjectById($id);

/**
 * Returns object by id.
 * @param int $id Id of object.
 * @return DiskFile|DiskFolder
 * @throws AccessException
 */
protected function get($id)
{
	$object = $this->getWorkObjectById($id);
	$securityContext = $object->getStorage()->getCurrentUserSecurityContext();
	if(!$object->canRead($securityContext))
	{
		throw new AccessException;
	}

	return $object;
}