Skip to content

Commit

Permalink
Merge pull request #41130 from nextcloud/backport/41123/stable21
Browse files Browse the repository at this point in the history
[stable21] fix(external): Get storage before update it
  • Loading branch information
nickvergessen authored Oct 26, 2023
2 parents 61b7233 + 984db91 commit 1c4920d
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 @@ -124,6 +124,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 1c4920d

Please sign in to comment.