Skip to content

Commit 4fe430c

Browse files
Merge pull request #41124 from nextcloud/backport/41123/stable27
[stable27] fix(external): Get storage before update it
2 parents 84c153e + 7105380 commit 4fe430c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

apps/files_external/lib/Service/UserStoragesService.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ public function addStorage(StorageConfig $newStorage) {
127127
* @throws NotFoundException if the given storage does not exist in the config
128128
*/
129129
public function updateStorage(StorageConfig $updatedStorage) {
130+
// verify ownership through $this->isApplicable() and otherwise throws an exception
131+
$this->getStorage($updatedStorage->getId());
132+
130133
$updatedStorage->setApplicableUsers([$this->getUser()->getUID()]);
131134
return parent::updateStorage($updatedStorage);
132135
}

0 commit comments

Comments
 (0)