summaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorTom Needham <tom@owncloud.com>2013-02-09 11:53:54 +0000
committerTom Needham <tom@owncloud.com>2013-02-09 11:53:54 +0000
commit5102596e6d461313cd10f64d033107ce1218a854 (patch)
tree9388147bb15c61f9be2fdf79b8c33138fa6d0561 /apps/files_versions
parent675afbc21374b03140f4570c585eace56875819a (diff)
downloadnextcloud-server-5102596e6d461313cd10f64d033107ce1218a854.tar.gz
nextcloud-server-5102596e6d461313cd10f64d033107ce1218a854.zip
Add capabilities exposure to the versioning app
Diffstat (limited to 'apps/files_versions')
-rw-r--r--apps/files_versions/appinfo/app.php1
-rw-r--r--apps/files_versions/appinfo/routes.php9
-rw-r--r--apps/files_versions/lib/capabilities.php22
3 files changed, 32 insertions, 0 deletions
diff --git a/apps/files_versions/appinfo/app.php b/apps/files_versions/appinfo/app.php
index edd0a2f7022..9ac86728cc6 100644
--- a/apps/files_versions/appinfo/app.php
+++ b/apps/files_versions/appinfo/app.php
@@ -3,6 +3,7 @@
//require_once 'files_versions/versions.php';
OC::$CLASSPATH['OCA_Versions\Storage'] = 'apps/files_versions/lib/versions.php';
OC::$CLASSPATH['OCA_Versions\Hooks'] = 'apps/files_versions/lib/hooks.php';
+OC::$CLASSPATH['OC_Files_Versions_Capabiltiies'] = 'apps/files_versions/lib/capabilities.php';
OCP\App::registerAdmin('files_versions', 'settings');
OCP\App::registerPersonal('files_versions', 'settings-personal');
diff --git a/apps/files_versions/appinfo/routes.php b/apps/files_versions/appinfo/routes.php
new file mode 100644
index 00000000000..125b96db175
--- /dev/null
+++ b/apps/files_versions/appinfo/routes.php
@@ -0,0 +1,9 @@
+<?php
+/**
+ * Copyright (c) 2013, Tom Needham <tom@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */
+
+// Register with the capabilities API
+OC_API::register('get', '/cloud/capabilities', array('OC_Files_Versions_Capabiltiies', 'getCapabilities'), 'ocs', OC_API::USER_AUTH); \ No newline at end of file
diff --git a/apps/files_versions/lib/capabilities.php b/apps/files_versions/lib/capabilities.php
new file mode 100644
index 00000000000..ac70773df06
--- /dev/null
+++ b/apps/files_versions/lib/capabilities.php
@@ -0,0 +1,22 @@
+<?php
+/**
+ * Copyright (c) 2013 Tom Needham <tom@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+class OC_Files_Versions_Capabilities {
+
+ public static function getCapabilities() {
+ return OC_OCS_Result(array(
+ 'capabilities' => array(
+ 'files_versions' => array(
+ 'versioning' => true,
+ ),
+ ),
+ ));
+ }
+
+}
+?> \ No newline at end of file