aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_versions/lib/Sabre/VersionFile.php
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2022-11-29 16:26:54 +0100
committerLouis (Rebase PR Action) <artonge@users.noreply.github.com>2023-01-26 10:12:23 +0000
commit6a2f8bc5997a4b40baf8b967d6d8ccdf29735d3b (patch)
tree116fa4a442c97ac44839e14460b797d50f77e4f2 /apps/files_versions/lib/Sabre/VersionFile.php
parent629de6c8c97f9a455944046737421b927b1e2d9b (diff)
downloadnextcloud-server-6a2f8bc5997a4b40baf8b967d6d8ccdf29735d3b.tar.gz
nextcloud-server-6a2f8bc5997a4b40baf8b967d6d8ccdf29735d3b.zip
Allow to delete a version through DAV
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps/files_versions/lib/Sabre/VersionFile.php')
-rw-r--r--apps/files_versions/lib/Sabre/VersionFile.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/files_versions/lib/Sabre/VersionFile.php b/apps/files_versions/lib/Sabre/VersionFile.php
index 9018f75703d..12590fe9efd 100644
--- a/apps/files_versions/lib/Sabre/VersionFile.php
+++ b/apps/files_versions/lib/Sabre/VersionFile.php
@@ -26,6 +26,7 @@ declare(strict_types=1);
*/
namespace OCA\Files_Versions\Sabre;
+use OCA\Files_Versions\Versions\IDeletableVersionBackend;
use OCA\Files_Versions\Versions\INameableVersion;
use OCA\Files_Versions\Versions\INameableVersionBackend;
use OCA\Files_Versions\Versions\IVersion;
@@ -72,8 +73,11 @@ class VersionFile implements IFile {
}
public function delete() {
- // TODO: implement version deletion
- throw new Forbidden();
+ if ($this->versionManager instanceof IDeletableVersionBackend) {
+ $this->versionManager->deleteVersion($this->version);
+ } else {
+ throw new Forbidden();
+ }
}
public function getName(): string {