Skip to content

Commit

Permalink
Merge pull request #39363 from nextcloud/backport/39323/39323-stable20
Browse files Browse the repository at this point in the history
[stable20] getStorage before remove
  • Loading branch information
blizzz committed Jul 17, 2023
2 parents d7694bc + 596b8e5 commit 7d870b5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/files_external/lib/Service/UserStoragesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,10 @@ public function getVisibilityType() {
protected function isApplicable(StorageConfig $config) {
return ($config->getApplicableUsers() === [$this->getUser()->getUID()]) && $config->getType() === StorageConfig::MOUNT_TYPE_PERSONAl;
}

public function removeStorage($id) {
// verify ownership through $this->isApplicable() and otherwise throws an exception
$this->getStorage($id);
parent::removeStorage($id);
}
}

0 comments on commit 7d870b5

Please sign in to comment.