• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/attachedobject.php
  • Класс: BitrixDiskAttachedObject
  • Вызов: AttachedObject::canUpdate
public function canUpdate($userId)
{
	//if attachedObject is version we don't know about self-rights and have to ask head-version (object) about canUpdate. But we don't make it (so expensive). Hack
	if($this->isSpecificVersion() && $this->createdBy && $this->createdBy == $userId)
	{
		return true;
	}
	if(!$this->isEditable)
	{
		return false;
	}
	//this is compatible mode after migrate from webdav with old uf attaches
	if($this->isEditable == 2 && !$this->getStubConnector()->canUpdate($userId))
	{
		return false;
	}

	//If user who attached object to entity had edit operation, then we will not ask Connector about rights (update)
	if($this->createdBy && $this->createdBy == $userId)
	{
		return true;
	}

	if(!$this->allowEdit)
	{
		return false;
	}

	$connector = $this->getConnector();
	if($connector->canConfidenceUpdateInOperableEntity() && $this->isConfidenceToOperableEntity())
	{
		return true;
	}

	//If user allow to edit object in entity - we ask entity about access $userId
	return $connector->canUpdate($userId);
}