summaryrefslogtreecommitdiffstats
path: root/apps/files_versions/lib/Versions/LegacyVersionsBackend.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2019-05-21 17:14:47 +0200
committerRobin Appelman <robin@icewind.nl>2019-05-21 17:14:47 +0200
commitccfbee2af953924c6b290104cdac1d5c6139f15b (patch)
tree4981cec01844a161dee62d98ccbb074f4ade85fd /apps/files_versions/lib/Versions/LegacyVersionsBackend.php
parenta3b4410283a0517b458deacc8ee704c12ec028bd (diff)
downloadnextcloud-server-ccfbee2af953924c6b290104cdac1d5c6139f15b.tar.gz
nextcloud-server-ccfbee2af953924c6b290104cdac1d5c6139f15b.zip
add way for version backends to programmatically specify if they should be used
this allows for backends that should only be used if specific conditions are met Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_versions/lib/Versions/LegacyVersionsBackend.php')
-rw-r--r--apps/files_versions/lib/Versions/LegacyVersionsBackend.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/files_versions/lib/Versions/LegacyVersionsBackend.php b/apps/files_versions/lib/Versions/LegacyVersionsBackend.php
index 99424f54564..aceddef29d2 100644
--- a/apps/files_versions/lib/Versions/LegacyVersionsBackend.php
+++ b/apps/files_versions/lib/Versions/LegacyVersionsBackend.php
@@ -29,6 +29,7 @@ use OCP\Files\FileInfo;
use OCP\Files\Folder;
use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
+use OCP\Files\Storage\IStorage;
use OCP\IUser;
use OCP\IUserManager;
@@ -43,6 +44,10 @@ class LegacyVersionsBackend implements IVersionBackend {
$this->userManager = $userManager;
}
+ public function useBackendForStorage(IStorage $storage): bool {
+ return true;
+ }
+
public function getVersionsForFile(IUser $user, FileInfo $file): array {
$storage = $file->getStorage();
if ($storage->instanceOfStorage(SharedStorage::class)) {