aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-11-19 11:42:19 +0100
committerMorris Jobke <hey@morrisjobke.de>2014-11-19 11:42:19 +0100
commitdc9eaf59dcede025edccf2d90cc211d739dbf935 (patch)
tree0b304a8699018a0ae51782379df9f087c7e48e26 /apps/files_trashbin
parent705976ba0aada1f60b968119d3807611acdd6c0b (diff)
parent61641293f47914413179b60c8124e5e966c772bb (diff)
downloadnextcloud-server-dc9eaf59dcede025edccf2d90cc211d739dbf935.tar.gz
nextcloud-server-dc9eaf59dcede025edccf2d90cc211d739dbf935.zip
Merge pull request #12276 from owncloud/undelete-only-if-files-trashin-is-enabled
Only show undelete capability if files_trashbin is enabled
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/appinfo/routes.php4
-rw-r--r--apps/files_trashbin/lib/capabilities.php32
2 files changed, 36 insertions, 0 deletions
diff --git a/apps/files_trashbin/appinfo/routes.php b/apps/files_trashbin/appinfo/routes.php
index da268f4fdfd..56dbf382735 100644
--- a/apps/files_trashbin/appinfo/routes.php
+++ b/apps/files_trashbin/appinfo/routes.php
@@ -13,3 +13,7 @@ $this->create('files_trashbin_ajax_list', 'ajax/list.php')
->actionInclude('files_trashbin/ajax/list.php');
$this->create('files_trashbin_ajax_undelete', 'ajax/undelete.php')
->actionInclude('files_trashbin/ajax/undelete.php');
+
+
+// Register with the capabilities API
+\OC_API::register('get', '/cloud/capabilities', array('OCA\Files_Trashbin\Capabilities', 'getCapabilities'), 'files_trashbin', \OC_API::USER_AUTH);
diff --git a/apps/files_trashbin/lib/capabilities.php b/apps/files_trashbin/lib/capabilities.php
new file mode 100644
index 00000000000..3f137d22b6f
--- /dev/null
+++ b/apps/files_trashbin/lib/capabilities.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Copyright (c) Lukas Reschke <lukas@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OCA\Files_Trashbin;
+
+
+/**
+ * Class Capabilities
+ *
+ * @package OCA\Files_Trashbin
+ */
+class Capabilities {
+
+ /**
+ * @return \OC_OCS_Result
+ */
+ public static function getCapabilities() {
+ return new \OC_OCS_Result(array(
+ 'capabilities' => array(
+ 'files' => array(
+ 'undelete' => true,
+ ),
+ ),
+ ));
+ }
+
+}