Skip to content

Commit

Permalink
Merge pull request #41124 from nextcloud/backport/41123/stable27
Browse files Browse the repository at this point in the history
[stable27] fix(external): Get storage before update it
  • Loading branch information
nickvergessen authored Oct 26, 2023
2 parents 84c153e + 7105380 commit 4fe430c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/files_external/lib/Service/UserStoragesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ public function addStorage(StorageConfig $newStorage) {
* @throws NotFoundException if the given storage does not exist in the config
*/
public function updateStorage(StorageConfig $updatedStorage) {
// verify ownership through $this->isApplicable() and otherwise throws an exception
$this->getStorage($updatedStorage->getId());

$updatedStorage->setApplicableUsers([$this->getUser()->getUID()]);
return parent::updateStorage($updatedStorage);
}
Expand Down

0 comments on commit 4fe430c

Please sign in to comment.