Skip to content

Commit

Permalink
Merge pull request #39354 from nextcloud/backport/39323/39323-stable27
Browse files Browse the repository at this point in the history
[stable27] getStorage before remove
  • Loading branch information
AndyScherzinger committed Jul 13, 2023
2 parents eae4a1e + 6c98f95 commit 8822258
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 @@ -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 8822258

Please sign in to comment.