mirror of
https://github.com/nextcloud/server.git
synced 2026-04-05 17:16:55 -04:00
feat: allow group's members to view fellow members
Signed-off-by: Kent Delante <kent.delante@proton.me>
This commit is contained in:
parent
2d87655e2c
commit
2908f81769
1 changed files with 4 additions and 1 deletions
|
|
@ -133,6 +133,8 @@ class GroupsController extends AUserDataOCSController {
|
|||
}
|
||||
|
||||
/**
|
||||
* @NoSubAdminRequired
|
||||
*
|
||||
* Get a list of users in the specified group
|
||||
*
|
||||
* @param string $groupId ID of the group
|
||||
|
|
@ -154,6 +156,7 @@ class GroupsController extends AUserDataOCSController {
|
|||
$group = $this->groupManager->get($groupId);
|
||||
if ($group !== null) {
|
||||
$isSubadminOfGroup = $this->groupManager->getSubAdmin()->isSubAdminOfGroup($user, $group);
|
||||
$isMember = $this->groupManager->isInGroup($user->getUID(), $group->getGID());
|
||||
} else {
|
||||
throw new OCSNotFoundException('The requested group could not be found');
|
||||
}
|
||||
|
|
@ -161,7 +164,7 @@ class GroupsController extends AUserDataOCSController {
|
|||
// Check subadmin has access to this group
|
||||
$isAdmin = $this->groupManager->isAdmin($user->getUID());
|
||||
$isDelegatedAdmin = $this->groupManager->isDelegatedAdmin($user->getUID());
|
||||
if ($isAdmin || $isDelegatedAdmin || $isSubadminOfGroup) {
|
||||
if ($isAdmin || $isDelegatedAdmin || $isSubadminOfGroup || $isMember) {
|
||||
$users = $this->groupManager->get($groupId)->getUsers();
|
||||
$users = array_map(function ($user) {
|
||||
/** @var IUser $user */
|
||||
|
|
|
|||
Loading…
Reference in a new issue