summaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api/lib/Capabilities.php
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2021-03-25 11:16:21 +0100
committerVincent Petry <vincent@nextcloud.com>2021-03-26 13:07:09 +0100
commitb66af8a4329852ee599438c5be74e9246b4e0a68 (patch)
tree08ba64d81ca36ec312169196a8cee3e03e86f7b4 /apps/provisioning_api/lib/Capabilities.php
parentb73df5846ce9c801e93e79e11e93a8cd73dabfdd (diff)
downloadnextcloud-server-b66af8a4329852ee599438c5be74e9246b4e0a68.tar.gz
nextcloud-server-b66af8a4329852ee599438c5be74e9246b4e0a68.zip
Add capability for editable scopes in provisioning API
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'apps/provisioning_api/lib/Capabilities.php')
-rw-r--r--apps/provisioning_api/lib/Capabilities.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/apps/provisioning_api/lib/Capabilities.php b/apps/provisioning_api/lib/Capabilities.php
new file mode 100644
index 00000000000..eaec844313f
--- /dev/null
+++ b/apps/provisioning_api/lib/Capabilities.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * @copyright Copyright (c) 2021 Vincent Petry <vincent@nextcloud.com>
+ *
+ * @author Vincent Petry <vincent@nextcloud.com>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * 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
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\Provisioning_API;
+
+use OCP\App\IAppManager;
+use OCP\Capabilities\ICapability;
+
+class Capabilities implements ICapability {
+
+ /** @var IAppManager */
+ private $appManager;
+
+ public function __construct(IAppManager $appManager) {
+ $this->appManager = $appManager;
+ }
+
+ /**
+ * Function an app uses to return the capabilities
+ *
+ * @return array Array containing the apps capabilities
+ */
+ public function getCapabilities() {
+ return [
+ 'provisioning_api' => [
+ 'version' => $this->appManager->getAppVersion('provisioning_api'),
+ 'hasAccountPropertyScopes' => true,
+ ]
+ ];
+ }
+}