diff options
author | Andy Scherzinger <info@andy-scherzinger.de> | 2023-07-13 14:10:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-13 14:10:25 +0200 |
commit | 166c63b8cac4b7620184e10e6c170c9225deb4e2 (patch) | |
tree | 0326f78f62558f20fddf6cadad68c68cf885c76b | |
parent | 4f785156160f4020b6cbc74e73c3de70276a9f81 (diff) | |
parent | 3af516921ca1f61ee43cc76284b3221710daaf36 (diff) | |
download | nextcloud-server-166c63b8cac4b7620184e10e6c170c9225deb4e2.tar.gz nextcloud-server-166c63b8cac4b7620184e10e6c170c9225deb4e2.zip |
Merge pull request #39356 from nextcloud/backport/39323/39323-stable25
[stable25] 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 b09b37b40cc..59682874038 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); + } } |