• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/uf/fileusertype.php
  • Класс: BitrixDiskUfFileUserType
  • Вызов: FileUserType::changeAllowEdit
static function changeAllowEdit(int $attachedObjectId, bool $allowEdit): void
{
	$attachedObject = AttachedObject::getById($attachedObjectId);
	if (!$attachedObject || (bool)$attachedObject->getAllowEdit() === $allowEdit)
	{
		return;
	}

	$currentUser = BitrixMainEngineCurrentUser::get();
	if ((int)$attachedObject->getCreatedBy() !== (int)$currentUser->getId())
	{
		return;
	}

	if (!$attachedObject->isEditable())
	{
		return;
	}

	if (!$attachedObject->canRead($currentUser->getId()))
	{
		return;
	}

	$attachedObject->changeAllowEdit($allowEdit);
}