mirror of
https://github.com/nextcloud/server.git
synced 2026-02-03 20:41:22 -05:00
refactor(provisioning_api): check user membership if non-admin
Signed-off-by: Kent Delante <kent.delante@proton.me>
This commit is contained in:
parent
52aed034b1
commit
2193f842e8
1 changed files with 6 additions and 1 deletions
|
|
@ -156,7 +156,6 @@ 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');
|
||||
}
|
||||
|
|
@ -164,6 +163,12 @@ class GroupsController extends AUserDataOCSController {
|
|||
// Check subadmin has access to this group
|
||||
$isAdmin = $this->groupManager->isAdmin($user->getUID());
|
||||
$isDelegatedAdmin = $this->groupManager->isDelegatedAdmin($user->getUID());
|
||||
$isMember = false;
|
||||
|
||||
if (!$isAdmin && !$isDelegatedAdmin && !$isSubadminOfGroup) {
|
||||
$isMember = $this->groupManager->isInGroup($user->getUID(), $group->getGID());
|
||||
}
|
||||
|
||||
if ($isAdmin || $isDelegatedAdmin || $isSubadminOfGroup || $isMember) {
|
||||
$users = $this->groupManager->get($groupId)->getUsers();
|
||||
$users = array_map(function ($user) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue