Class GroupResource

java.lang.Object
org.keycloak.services.resources.admin.GroupResource

public class GroupResource extends Object
Author:
Bill Burke
  • Constructor Summary

    Constructors
    Constructor
    Description
    GroupResource(org.keycloak.models.RealmModel realm, org.keycloak.models.GroupModel group, org.keycloak.models.KeycloakSession session, AdminPermissionEvaluator auth, AdminEventBuilder adminEvent)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    jakarta.ws.rs.core.Response
    addChild(org.keycloak.representations.idm.GroupRepresentation rep)
    Set or create child.
    void
     
    org.keycloak.representations.idm.GroupRepresentation
     
    org.keycloak.representations.idm.ManagementPermissionReference
    Return object stating whether client Authorization permissions have been initialized or not and a reference
    Stream<org.keycloak.representations.idm.UserRepresentation>
    getMembers(Integer firstResult, Integer maxResults, Boolean briefRepresentation)
    Get users Returns a stream of users, filtered according to query parameters
     
    Stream<org.keycloak.representations.idm.GroupRepresentation>
    getSubGroups(String search, Boolean exact, Integer first, Integer max, Boolean briefRepresentation, Boolean subGroupsCount)
     
    org.keycloak.representations.idm.ManagementPermissionReference
    setManagementPermissionsEnabled(org.keycloak.representations.idm.ManagementPermissionReference ref)
    Return object stating whether client Authorization permissions have been initialized or not and a reference
    jakarta.ws.rs.core.Response
    updateGroup(org.keycloak.representations.idm.GroupRepresentation rep)
    Update group, ignores subgroups.
    static void
    updateGroup(org.keycloak.representations.idm.GroupRepresentation rep, org.keycloak.models.GroupModel model, org.keycloak.models.RealmModel realm, org.keycloak.models.KeycloakSession session)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GroupResource

      public GroupResource(org.keycloak.models.RealmModel realm, org.keycloak.models.GroupModel group, org.keycloak.models.KeycloakSession session, AdminPermissionEvaluator auth, AdminEventBuilder adminEvent)
  • Method Details

    • getGroup

      @GET @Produces("application/json") public org.keycloak.representations.idm.GroupRepresentation getGroup()
      Returns:
    • updateGroup

      @PUT @Consumes("application/json") public jakarta.ws.rs.core.Response updateGroup(org.keycloak.representations.idm.GroupRepresentation rep)
      Update group, ignores subgroups.
      Parameters:
      rep -
    • deleteGroup

      @DELETE public void deleteGroup()
    • getSubGroups

      @GET @Path("children") @Produces("application/json") public Stream<org.keycloak.representations.idm.GroupRepresentation> getSubGroups(@QueryParam("search") String search, @QueryParam("exact") Boolean exact, @QueryParam("first") @DefaultValue("0") Integer first, @QueryParam("max") @DefaultValue("10") Integer max, @QueryParam("briefRepresentation") @DefaultValue("false") Boolean briefRepresentation, @QueryParam("subGroupsCount") @DefaultValue("true") Boolean subGroupsCount)
    • addChild

      @POST @Path("children") @Produces("application/json") @Consumes("application/json") public jakarta.ws.rs.core.Response addChild(org.keycloak.representations.idm.GroupRepresentation rep)
      Set or create child. This will just set the parent if it exists. Create it and set the parent if the group doesn't exist.
      Parameters:
      rep -
    • updateGroup

      public static void updateGroup(org.keycloak.representations.idm.GroupRepresentation rep, org.keycloak.models.GroupModel model, org.keycloak.models.RealmModel realm, org.keycloak.models.KeycloakSession session)
    • getRoleMappings

      @Path("role-mappings") public RoleMapperResource getRoleMappings()
    • getMembers

      @GET @Path("members") @Produces("application/json") public Stream<org.keycloak.representations.idm.UserRepresentation> getMembers(@QueryParam("first") Integer firstResult, @QueryParam("max") Integer maxResults, @QueryParam("briefRepresentation") Boolean briefRepresentation)
      Get users Returns a stream of users, filtered according to query parameters
      Parameters:
      firstResult - Pagination offset
      maxResults - Maximum results size (defaults to 100)
      briefRepresentation - Only return basic information (only guaranteed to return id, username, created, first and last name, email, enabled state, email verification state, federation link, and access. Note that it means that namely user attributes, required actions, and not before are not returned.)
      Returns:
      a non-null Stream of users
    • getManagementPermissions

      @Path("management/permissions") @GET @Produces("application/json") public org.keycloak.representations.idm.ManagementPermissionReference getManagementPermissions()
      Return object stating whether client Authorization permissions have been initialized or not and a reference
      Returns:
    • setManagementPermissionsEnabled

      @Path("management/permissions") @PUT @Produces("application/json") @Consumes("application/json") public org.keycloak.representations.idm.ManagementPermissionReference setManagementPermissionsEnabled(org.keycloak.representations.idm.ManagementPermissionReference ref)
      Return object stating whether client Authorization permissions have been initialized or not and a reference
      Returns:
      initialized manage permissions reference