From 5f8ee1c49d0f8f6d6458a7df7a14c93942708068 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Fri, 27 Jan 2023 20:20:26 +0100 Subject: [PATCH] add fine grain access to subgroups (#16672) fixes: https://github.com/keycloak/keycloak-ui/issues/4195 --- .../org/keycloak/admin/ui/rest/GroupsResource.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rest/admin-ui-ext/src/main/java/org/keycloak/admin/ui/rest/GroupsResource.java b/rest/admin-ui-ext/src/main/java/org/keycloak/admin/ui/rest/GroupsResource.java index ef3fe85f53..d9b307992b 100644 --- a/rest/admin-ui-ext/src/main/java/org/keycloak/admin/ui/rest/GroupsResource.java +++ b/rest/admin-ui-ext/src/main/java/org/keycloak/admin/ui/rest/GroupsResource.java @@ -76,10 +76,13 @@ public class GroupsResource { groupMatchesSearchOrIsPathElement( g, search ) - ).map(subGroup -> - ModelToRepresentation.toGroupHierarchy( - subGroup, true, search, exact - ) + ).map(subGroup -> { + final GroupRepresentation subRep = ModelToRepresentation.toGroupHierarchy( + subGroup, true, search, exact + ); + subRep.setAccess(auth.groups().getAccess(subGroup)); + return subRep; + } ).collect(Collectors.toList())); return rep;