summaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api
diff options
context:
space:
mode:
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
*/