aboutsummaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2019-10-05 18:34:14 +0200
committerGitHub <noreply@github.com>2019-10-05 18:34:14 +0200
commit62399c76e81755e385f4c6858c5ee578d19b7e54 (patch)
tree450dacec7013d4a65cb9d18b1e0ab1a084e96ae7 /apps/provisioning_api
parent637c50e647d4d47d79248497d80ad63a20c09fd6 (diff)
parentb9f963225ff646eabd9c6cd1bb6799eba99d3c79 (diff)
downloadnextcloud-server-62399c76e81755e385f4c6858c5ee578d19b7e54.tar.gz
nextcloud-server-62399c76e81755e385f4c6858c5ee578d19b7e54.zip
Allow group displaynames in the database backend (#17221)
Allow group displaynames in the database backend
Diffstat (limited to 'apps/provisioning_api')
-rw-r--r--apps/provisioning_api/appinfo/routes.php1
-rw-r--r--apps/provisioning_api/lib/Controller/GroupsController.php24
2 files changed, 24 insertions, 1 deletions
diff --git a/apps/provisioning_api/appinfo/routes.php b/apps/provisioning_api/appinfo/routes.php
index fb0a6b235ce..ef13159af5b 100644
--- a/apps/provisioning_api/appinfo/routes.php
+++ b/apps/provisioning_api/appinfo/routes.php
@@ -40,6 +40,7 @@ return [
['root' => '/cloud', 'name' => 'Groups#getSubAdminsOfGroup', 'url' => '/groups/{groupId}/subadmins', 'verb' => 'GET', 'requirements' => ['groupId' => '.+']],
['root' => '/cloud', 'name' => 'Groups#addGroup', 'url' => '/groups', 'verb' => 'POST'],
['root' => '/cloud', 'name' => 'Groups#getGroup', 'url' => '/groups/{groupId}', 'verb' => 'GET', 'requirements' => ['groupId' => '.+']],
+ ['root' => '/cloud', 'name' => 'Groups#updateGroup', 'url' => '/groups/{groupId}', 'verb' => 'PUT', 'requirements' => ['groupId' => '.+']],
['root' => '/cloud', 'name' => 'Groups#deleteGroup', 'url' => '/groups/{groupId}', 'verb' => 'DELETE', 'requirements' => ['groupId' => '.+']],
// Users
diff --git a/apps/provisioning_api/lib/Controller/GroupsController.php b/apps/provisioning_api/lib/Controller/GroupsController.php
index 7c4447ac4eb..72285f55192 100644
--- a/apps/provisioning_api/lib/Controller/GroupsController.php
+++ b/apps/provisioning_api/lib/Controller/GroupsController.php
@@ -129,7 +129,7 @@ class GroupsController extends AUserData {
*
* @param string $groupId
* @return DataResponse
- * @throws OCSException
+ * @throws OCSException
*
* @deprecated 14 Use getGroupUsers
*/
@@ -252,6 +252,28 @@ class GroupsController extends AUserData {
* @PasswordConfirmationRequired
*
* @param string $groupId
+ * @param string $key
+ * @param string $value
+ * @return DataResponse
+ * @throws OCSException
+ */
+ public function updateGroup(string $groupId, string $key, string $value): DataResponse {
+ if ($key === 'displayname') {
+ $group = $this->groupManager->get($groupId);
+ if ($group->setDisplayName($value)) {
+ return new DataResponse();
+ }
+
+ throw new OCSException('Not supported by backend', 101);
+ } else {
+ throw new OCSException('', \OCP\API::RESPOND_UNAUTHORISED);
+ }
+ }
+
+ /**
+ * @PasswordConfirmationRequired
+ *
+ * @param string $groupId
* @return DataResponse
* @throws OCSException
*/