diff options
author | Joas Schilling <coding@schilljs.com> | 2019-09-20 11:33:02 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2019-09-27 14:29:56 +0200 |
commit | 653628c8fb69dc3f9d26751520f91e43a18f17ae (patch) | |
tree | ef2dfb5f01bc19e09386364895ec9c8620ec3257 /apps/provisioning_api/lib/Controller | |
parent | 45506adc5c2a34a8c812a2a3c9273a8447b450af (diff) | |
download | nextcloud-server-653628c8fb69dc3f9d26751520f91e43a18f17ae.tar.gz nextcloud-server-653628c8fb69dc3f9d26751520f91e43a18f17ae.zip |
Allow to set the group display name in the database backend
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/provisioning_api/lib/Controller')
-rw-r--r-- | apps/provisioning_api/lib/Controller/GroupsController.php | 24 |
1 files changed, 23 insertions, 1 deletions
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 */ |