diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2023-07-13 10:18:31 -0100 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2023-07-13 10:31:46 -0100 |
commit | bb189784f28e96c87093b9967e4c6b4eaa713369 (patch) | |
tree | af232884387e6a27850d6899cc890cbcb517b46c | |
parent | a06ef707bb34e8e32a0c26db8a5ac7b32fb0a513 (diff) | |
download | nextcloud-server-bb189784f28e96c87093b9967e4c6b4eaa713369.tar.gz nextcloud-server-bb189784f28e96c87093b9967e4c6b4eaa713369.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 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); + } } |