summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2021-10-15 20:59:43 +0200
committerGitHub <noreply@github.com>2021-10-15 20:59:43 +0200
commita67a12cb96250144c47ffb99ac1efa8a8c51a6b3 (patch)
tree70f6805d16880edcdcff4ae332e8c3e571db6446 /apps/user_ldap
parentff67ada049fdb26f881450f7899f8eccfcd33310 (diff)
parent719dbafd1339702a170f04ebbc4f20e80d45e8c9 (diff)
downloadnextcloud-server-a67a12cb96250144c47ffb99ac1efa8a8c51a6b3.tar.gz
nextcloud-server-a67a12cb96250144c47ffb99ac1efa8a8c51a6b3.zip
Merge pull request #29240 from nextcloud/work/admin-delegation-implementation
Add support for Delegation Settings for more apps
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/lib/Controller/ConfigAPIController.php13
-rw-r--r--apps/user_ldap/lib/Settings/Admin.php12
2 files changed, 19 insertions, 6 deletions
diff --git a/apps/user_ldap/lib/Controller/ConfigAPIController.php b/apps/user_ldap/lib/Controller/ConfigAPIController.php
index cf09c6acd06..72ded754880 100644
--- a/apps/user_ldap/lib/Controller/ConfigAPIController.php
+++ b/apps/user_ldap/lib/Controller/ConfigAPIController.php
@@ -76,7 +76,7 @@ class ConfigAPIController extends OCSController {
}
/**
- * creates a new (empty) configuration and returns the resulting prefix
+ * Creates a new (empty) configuration and returns the resulting prefix
*
* Example: curl -X POST -H "OCS-APIREQUEST: true" -u $admin:$password \
* https://nextcloud.server/ocs/v2.php/apps/user_ldap/api/v1/config
@@ -110,6 +110,7 @@ class ConfigAPIController extends OCSController {
*
* For JSON output provide the format=json parameter
*
+ * @AuthorizedAdminSetting(settings=OCA\User_LDAP\Settings\Admin)
* @return DataResponse
* @throws OCSException
*/
@@ -142,6 +143,7 @@ class ConfigAPIController extends OCSController {
* <data/>
* </ocs>
*
+ * @AuthorizedAdminSetting(settings=OCA\User_LDAP\Settings\Admin)
* @param string $configID
* @return DataResponse
* @throws OCSBadRequestException
@@ -164,7 +166,7 @@ class ConfigAPIController extends OCSController {
}
/**
- * modifies a configuration
+ * Modifies a configuration
*
* Example:
* curl -X PUT -d "configData[ldapHost]=ldaps://my.ldap.server&configData[ldapPort]=636" \
@@ -181,6 +183,7 @@ class ConfigAPIController extends OCSController {
* <data/>
* </ocs>
*
+ * @AuthorizedAdminSetting(settings=OCA\User_LDAP\Settings\Admin)
* @param string $configID
* @param array $configData
* @return DataResponse
@@ -216,7 +219,7 @@ class ConfigAPIController extends OCSController {
}
/**
- * retrieves a configuration
+ * Retrieves a configuration
*
* <?xml version="1.0"?>
* <ocs>
@@ -280,6 +283,7 @@ class ConfigAPIController extends OCSController {
* </data>
* </ocs>
*
+ * @AuthorizedAdminSetting(settings=OCA\User_LDAP\Settings\Admin)
* @param string $configID
* @param bool|string $showPassword
* @return DataResponse
@@ -311,8 +315,9 @@ class ConfigAPIController extends OCSController {
}
/**
- * if the given config ID is not available, an exception is thrown
+ * If the given config ID is not available, an exception is thrown
*
+ * @AuthorizedAdminSetting(settings=OCA\User_LDAP\Settings\Admin)
* @param string $configID
* @throws OCSNotFoundException
*/
diff --git a/apps/user_ldap/lib/Settings/Admin.php b/apps/user_ldap/lib/Settings/Admin.php
index 21ad82b96ed..21805b6f7b5 100644
--- a/apps/user_ldap/lib/Settings/Admin.php
+++ b/apps/user_ldap/lib/Settings/Admin.php
@@ -29,10 +29,10 @@ use OCA\User_LDAP\Configuration;
use OCA\User_LDAP\Helper;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IL10N;
-use OCP\Settings\ISettings;
+use OCP\Settings\IDelegatedSettings;
use OCP\Template;
-class Admin implements ISettings {
+class Admin implements IDelegatedSettings {
/** @var IL10N */
private $l;
@@ -98,4 +98,12 @@ class Admin implements ISettings {
public function getPriority() {
return 5;
}
+
+ public function getName(): ?string {
+ return null; // Only one setting in this section
+ }
+
+ public function getAuthorizedAppConfig(): array {
+ return []; // Custom controller
+ }
}