Skip to content

Commit

Permalink
Merge pull request #39323 from nextcloud/fix/noid/getstorge-before-rm
Browse files Browse the repository at this point in the history
files_external: getStorage before remove
  • Loading branch information
ArtificialOwl authored Jul 13, 2023
2 parents 7c9e5ee + b99020a commit a82291f
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 @@ -143,4 +143,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 a82291f

Please sign in to comment.