diff options
author | Andy Scherzinger <info@andy-scherzinger.de> | 2023-07-13 14:17:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-13 14:17:24 +0200 |
commit | 882225867d7ec92c1b016a83eba77f075339d013 (patch) | |
tree | a08aff0a52a745acca267d7dedea0693a242598a | |
parent | eae4a1ea51d7f7d3ca3075cdd640e2abf27ce1ac (diff) | |
parent | 6c98f951d5bd278765bd0c12aba15f38de6cecf1 (diff) | |
download | nextcloud-server-882225867d7ec92c1b016a83eba77f075339d013.tar.gz nextcloud-server-882225867d7ec92c1b016a83eba77f075339d013.zip |
Merge pull request #39354 from nextcloud/backport/39323/39323-stable27
[stable27] getStorage before remove
-rw-r--r-- | apps/files_external/lib/Service/UserStoragesService.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/files_external/lib/Service/UserStoragesService.php b/apps/files_external/lib/Service/UserStoragesService.php index 9a1e4e648b3..6cf34000ab0 100644 --- a/apps/files_external/lib/Service/UserStoragesService.php +++ b/apps/files_external/lib/Service/UserStoragesService.php @@ -143,4 +143,10 @@ class UserStoragesService extends StoragesService { 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); + } } |