summaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api/lib
diff options
context:
space:
mode:
authorDries Mys <dries.mys@my-dreams.be>2021-05-24 18:53:25 +0200
committerDries Mys <dries.mys@my-dreams.be>2021-06-05 22:22:38 +0200
commit101153c11d3c74899caa41fbd21763371efccc39 (patch)
tree5bd899ad1518199bb81931aeaa2d10dbaa8e5cd5 /apps/provisioning_api/lib
parentb211d02e9c0e1c2f5d3eed0916810d8db732237e (diff)
downloadnextcloud-server-101153c11d3c74899caa41fbd21763371efccc39.tar.gz
nextcloud-server-101153c11d3c74899caa41fbd21763371efccc39.zip
[ProvisioningAPI] Allow specifying group display name during creation
Signed-off-by: Dries Mys <dries.mys@my-dreams.be>
Diffstat (limited to 'apps/provisioning_api/lib')
-rw-r--r--apps/provisioning_api/lib/Controller/GroupsController.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/provisioning_api/lib/Controller/GroupsController.php b/apps/provisioning_api/lib/Controller/GroupsController.php
index 543fc3b40ac..ce10d034097 100644
--- a/apps/provisioning_api/lib/Controller/GroupsController.php
+++ b/apps/provisioning_api/lib/Controller/GroupsController.php
@@ -232,10 +232,11 @@ class GroupsController extends AUserData {
* @PasswordConfirmationRequired
*
* @param string $groupid
+ * @param string $displayname
* @return DataResponse
* @throws OCSException
*/
- public function addGroup(string $groupid): DataResponse {
+ public function addGroup(string $groupid, string $displayname = ''): DataResponse {
// Validate name
if (empty($groupid)) {
$this->logger->error('Group name not supplied', ['app' => 'provisioning_api']);
@@ -245,7 +246,10 @@ class GroupsController extends AUserData {
if ($this->groupManager->groupExists($groupid)) {
throw new OCSException('group exists', 102);
}
- $this->groupManager->createGroup($groupid);
+ $group = $this->groupManager->createGroup($groupid);
+ if ($displayname !== '') {
+ $group->setDisplayName($displayname);
+ }
return new DataResponse();
}