Merge pull request #39361 from nextcloud/backport/39323/39323-stable22

[stable22] getStorage before remove
pull/39422/head
Andy Scherzinger 10 months ago committed by GitHub
commit 144461bbeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -140,4 +140,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);
}
}

Loading…
Cancel
Save