Class GroupsResource
java.lang.Object
org.keycloak.services.resources.admin.GroupsResource
- Author:
- Bill Burke
-
Constructor Summary
ConstructorsConstructorDescriptionGroupsResource(RealmModel realm, KeycloakSession session, AdminPermissionEvaluator auth, AdminEventBuilder adminEvent) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponseaddTopLevelGroup(org.keycloak.representations.idm.GroupRepresentation rep) create or add a top level realm groupSet or create child.getGroupById(String id) Does not expand hierarchy.getGroupCount(String search, boolean onlyTopGroups) Returns the groups counts.Stream<org.keycloak.representations.idm.GroupRepresentation>getGroups(String search, String searchQuery, Boolean exact, Integer firstResult, Integer maxResults, boolean briefRepresentation, boolean populateHierarchy, Boolean subGroupsCount) Get group hierarchy.
-
Constructor Details
-
GroupsResource
public GroupsResource(RealmModel realm, KeycloakSession session, AdminPermissionEvaluator auth, AdminEventBuilder adminEvent)
-
-
Method Details
-
getGroups
@GET @Produces("application/json") public Stream<org.keycloak.representations.idm.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, @QueryParam("populateHierarchy") @DefaultValue("true") boolean populateHierarchy, @QueryParam("subGroupsCount") @DefaultValue("true") Boolean subGroupsCount) Get group hierarchy. Onlynameandidare returned.subGroupsare only returned when using thesearchorqparameter. If none of these parameters is provided, the top-level groups are returned without `subGroupsbeing filled.- Returns:
-
getGroupById
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 jakarta.ws.rs.core.Response addTopLevelGroup(org.keycloak.representations.idm.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-
-