diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2023-07-11 17:36:17 -0100 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2023-07-13 10:41:04 -0100 |
commit | 3af516921ca1f61ee43cc76284b3221710daaf36 (patch) | |
tree | 0326f78f62558f20fddf6cadad68c68cf885c76b | |
parent | 4f785156160f4020b6cbc74e73c3de70276a9f81 (diff) | |
download | nextcloud-server-3af516921ca1f61ee43cc76284b3221710daaf36.tar.gz nextcloud-server-3af516921ca1f61ee43cc76284b3221710daaf36.zip |
getStorage before remove
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-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); + } } |