• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/controller/sharing.php
  • Класс: BitrixDiskControllerSharing
  • Вызов: Sharing::deleteAction
public function deleteAction(DiskSharing $sharing)
{
	$currentUserId = $this->getCurrentUser()->getId();
	$baseObject = $sharing->getRealObject();
	if (!$baseObject)
	{
		$this->errorCollection[] = new Error('Could not find object');

		return;
	}

	$securityContext = $baseObject->getStorage()->getSecurityContext($currentUserId);
	if (!$baseObject->canChangeRights($securityContext))
	{
		$this->errorCollection[] = new Error(Loc::getMessage('DISK_ERROR_MESSAGE_DENIED'));

		return;
	}

	if (!$sharing->delete($currentUserId))
	{
		$this->errorCollection->add($sharing->getErrors());
	}
}