]> source.dussan.org Git - nextcloud-server.git/commitdiff
getStorage before remove 39323/head
authorMaxence Lange <maxence@artificial-owl.com>
Tue, 11 Jul 2023 18:36:17 +0000 (17:36 -0100)
committerMaxence Lange <maxence@artificial-owl.com>
Tue, 11 Jul 2023 18:36:17 +0000 (17:36 -0100)
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
apps/files_external/lib/Service/UserStoragesService.php

index 9a1e4e648b3aa57c9d2c58ec95f145eeed39afcf..6cf34000ab0098b1f1f07ac234763ddc80d24dfb 100644 (file)
@@ -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);
+       }
 }