Skip to content

Commit

Permalink
Merge pull request #39365 from nextcloud/backport/39323/39323-stable19
Browse files Browse the repository at this point in the history
[stable19] getStorage before remove
  • Loading branch information
blizzz committed Jul 17, 2023
2 parents 3afb44d + 99fb6be commit 64980e6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/files_external/lib/Service/UserStoragesService.php
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 64980e6

Please sign in to comment.