summaryrefslogtreecommitdiffstats
path: root/lib/public/capabilities/icapability.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2015-03-21 20:03:56 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2015-08-10 10:45:08 +0200
commit7e6a2b71fd80fedabc64d10bee5ba0edc0b19cf0 (patch)
tree885ca90351d6b7fd94bf7e843f3cb15d62378c49 /lib/public/capabilities/icapability.php
parent214729a5524e2c406415985717c174bedc810954 (diff)
downloadnextcloud-server-7e6a2b71fd80fedabc64d10bee5ba0edc0b19cf0.tar.gz
nextcloud-server-7e6a2b71fd80fedabc64d10bee5ba0edc0b19cf0.zip
Added Capabilities Manager
* This should allow the capabilities to be intergrated into the appframework * Unit tests * Throw exception if closure does not return ICapability instance
Diffstat (limited to 'lib/public/capabilities/icapability.php')
-rw-r--r--lib/public/capabilities/icapability.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/lib/public/capabilities/icapability.php b/lib/public/capabilities/icapability.php
new file mode 100644
index 00000000000..71a56128d26
--- /dev/null
+++ b/lib/public/capabilities/icapability.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * @author Roeland Jago Douma <roeland@famdouma.nl>
+ *
+ * @copyright Copyright (c) 2015, ownCloud, Inc.
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+namespace OCP\Capabilities;
+
+/**
+ * Minimal interface that has to be implemented for a class to be considered
+ * a capability.
+ *
+ * In an application use:
+ * $this->getContainer()->registerCapability('OCA\MY_APP\Capabilities');
+ * To register capabilities.
+ *
+ * The class 'OCA\MY_APP\Capabilities' must then implement ICapability
+ *
+ * @since 8.2.0
+ */
+interface ICapability {
+
+ /**
+ * Function an app uses to return the capabilities
+ *
+ * @return array Array containing the apps capabilities
+ * @since 8.2.0
+ */
+ public function getCapabilities();
+}
+