aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2023-07-11 17:36:17 -0100
committerMaxence Lange <maxence@artificial-owl.com>2023-07-11 17:36:17 -0100
commitb99020a6f768eb731c8006b0314259afb0f3db04 (patch)
treea77bf1714b77649e3ef9359d0d0b89382df2426c /apps/files_external
parent46247e670a11f688805ca360998a381dfbecc8cc (diff)
downloadnextcloud-server-b99020a6f768eb731c8006b0314259afb0f3db04.tar.gz
nextcloud-server-b99020a6f768eb731c8006b0314259afb0f3db04.zip
getStorage before remove
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/Service/UserStoragesService.php6
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);
+ }
}