Class GroupsResource
- java.lang.Object
-
- org.keycloak.services.resources.admin.GroupsResource
-
public class GroupsResource extends Object
- Author:
- Bill Burke
-
-
Constructor Summary
Constructors Constructor Description GroupsResource(RealmModel realm, KeycloakSession session, AdminPermissionEvaluator auth, AdminEventBuilder adminEvent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.Response
addTopLevelGroup(GroupRepresentation rep)
create or add a top level realm groupSet or create child.GroupResource
getGroupById(String id)
Does not expand hierarchy.Map<String,Long>
getGroupCount(String search, boolean onlyTopGroups)
Returns the groups counts.Stream<GroupRepresentation>
getGroups(String search, String searchQuery, Boolean exact, Integer firstResult, Integer maxResults, boolean briefRepresentation)
Get group hierarchy.
-
-
-
Constructor Detail
-
GroupsResource
public GroupsResource(RealmModel realm, KeycloakSession session, AdminPermissionEvaluator auth, AdminEventBuilder adminEvent)
-
-
Method Detail
-
getGroups
@GET @Produces("application/json") public Stream<GroupRepresentation> getGroups(@QueryParam("search") String search, @QueryParam("q") String searchQuery, @QueryParam("exact") @DefaultValue("false") Boolean exact, @QueryParam("first") Integer firstResult, @QueryParam("max") Integer maxResults, @QueryParam("briefRepresentation") @DefaultValue("true") boolean briefRepresentation)
Get group hierarchy. Only name and ids are returned.- Returns:
-
getGroupById
@Path("{id}") public GroupResource getGroupById(@PathParam("id") String id)
Does not expand hierarchy. Subgroups will not be set.- Parameters:
id
-- Returns:
-
getGroupCount
@GET @Path("count") @Produces("application/json") public Map<String,Long> getGroupCount(@QueryParam("search") String search, @QueryParam("top") @DefaultValue("false") boolean onlyTopGroups)
Returns the groups counts.- Returns:
-
addTopLevelGroup
@POST @Consumes("application/json") public javax.ws.rs.core.Response addTopLevelGroup(GroupRepresentation rep)
create or add a top level realm groupSet or create child. This will update the group and set the parent if it exists. Create it and set the parent if the group doesn't exist.- Parameters:
rep
-
-
-