Skip to content

Commit 706c78f

Browse files
Merge pull request #54691 from nextcloud/leftybournes/feat/teams_groups_readonly
2 parents 5cbda35 + 2908f81 commit 706c78f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apps/provisioning_api/lib/Controller/GroupsController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ public function getGroup(string $groupId): DataResponse {
133133
}
134134

135135
/**
136+
* @NoSubAdminRequired
137+
*
136138
* Get a list of users in the specified group
137139
*
138140
* @param string $groupId ID of the group
@@ -154,14 +156,15 @@ public function getGroupUsers(string $groupId): DataResponse {
154156
$group = $this->groupManager->get($groupId);
155157
if ($group !== null) {
156158
$isSubadminOfGroup = $this->groupManager->getSubAdmin()->isSubAdminOfGroup($user, $group);
159+
$isMember = $this->groupManager->isInGroup($user->getUID(), $group->getGID());
157160
} else {
158161
throw new OCSNotFoundException('The requested group could not be found');
159162
}
160163

161164
// Check subadmin has access to this group
162165
$isAdmin = $this->groupManager->isAdmin($user->getUID());
163166
$isDelegatedAdmin = $this->groupManager->isDelegatedAdmin($user->getUID());
164-
if ($isAdmin || $isDelegatedAdmin || $isSubadminOfGroup) {
167+
if ($isAdmin || $isDelegatedAdmin || $isSubadminOfGroup || $isMember) {
165168
$users = $this->groupManager->get($groupId)->getUsers();
166169
$users = array_map(function ($user) {
167170
/** @var IUser $user */

0 commit comments

Comments
 (0)