]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix: Return only administered groups of a user for subadmins fix/subadmin-user-groups 44141/head
authorChristopher Ng <chrng8@gmail.com>
Tue, 12 Mar 2024 00:53:33 +0000 (17:53 -0700)
committerPytal <24800714+Pytal@users.noreply.github.com>
Wed, 22 May 2024 23:13:23 +0000 (16:13 -0700)
Signed-off-by: Christopher Ng <chrng8@gmail.com>
apps/provisioning_api/lib/Controller/AUserData.php

index 77d7f31c6daf579d8acd754c1447cef86d5a2d3c..6bba552a420b3613c1b853a0ec81fbef5aa468b2 100644 (file)
@@ -137,6 +137,9 @@ abstract class AUserData extends OCSController {
                $groups = $this->groupManager->getUserGroups($targetUserObject);
                $gids = [];
                foreach ($groups as $group) {
+                       if (!$this->groupManager->getSubAdmin()->isSubAdminOfGroup($currentLoggedInUser, $group)) {
+                               continue;
+                       };
                        $gids[] = $group->getGID();
                }