]> source.dussan.org Git - nextcloud-server.git/commitdiff
getStorage before remove 39355/head
authorMaxence Lange <maxence@artificial-owl.com>
Thu, 13 Jul 2023 11:18:31 +0000 (10:18 -0100)
committerMaxence Lange <maxence@artificial-owl.com>
Thu, 13 Jul 2023 11:31:46 +0000 (10:31 -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);
+       }
 }