org.keycloak.services.resources.admin

## Class RoleMapperResource

- java.lang.Object
- - org.keycloak.services.resources.admin.RoleMapperResource

-     public class RoleMapperResource
      extends Object

  Base resource for managing users
  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ClientConnection` | `clientConnection`
    `protected javax.ws.rs.core.HttpHeaders` | `headers`
    `protected static ServicesLogger` | `logger`
    `protected RealmModel` | `realm`
    `protected KeycloakSession` | `session`
    `protected javax.ws.rs.core.UriInfo` | `uriInfo`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RoleMapperResource(RealmModel realm, RealmAuth auth, RoleMapperModel roleMapper, AdminEventBuilder adminEvent)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRealmRoleMappings(List<RoleRepresentation> roles)` Add realm-level role mappings to the user
    `void` | `deleteRealmRoleMappings(List<RoleRepresentation> roles)` Delete realm-level role mappings
    `List<RoleRepresentation>` | `getAvailableRealmRoleMappings()` Get realm-level roles that can be mapped
    `List<RoleRepresentation>` | `getCompositeRealmRoleMappings()` Get effective realm-level role mappings This will recurse all composite roles to get the result.
    `List<RoleRepresentation>` | `getRealmRoleMappings()` Get realm-level role mappings
    `MappingsRepresentation` | `getRoleMappings()` Get role mappings
    `ClientRoleMappingsResource` | `getUserClientRoleMappingsResource(String client)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### logger

          protected static final ServicesLogger logger

    - #### realm

          protected RealmModel realm

    - #### clientConnection

          @Context
          protected ClientConnection clientConnection

    - #### uriInfo

          @Context
          protected javax.ws.rs.core.UriInfo uriInfo

    - #### session

          @Context
          protected KeycloakSession session

    - #### headers

          @Context
          protected javax.ws.rs.core.HttpHeaders headers

  - ### Constructor Detail

    - #### RoleMapperResource

          public RoleMapperResource(RealmModel realm,
                                    RealmAuth auth,
                                    RoleMapperModel roleMapper,
                                    AdminEventBuilder adminEvent)

  - ### Method Detail

    - #### getRoleMappings

          @GET
           @Produces(value="application/json")
          public MappingsRepresentation getRoleMappings()

      Get role mappings
      Returns:

    - #### getRealmRoleMappings

          @Path(value="realm")
           @GET
           @Produces(value="application/json")
          public List<RoleRepresentation> getRealmRoleMappings()

      Get realm-level role mappings
      Returns:

    - #### getCompositeRealmRoleMappings

          @Path(value="realm/composite")
           @GET
           @Produces(value="application/json")
          public List<RoleRepresentation> getCompositeRealmRoleMappings()

      Get effective realm-level role mappings This will recurse all composite roles to get the result.
      Returns:

    - #### getAvailableRealmRoleMappings

          @Path(value="realm/available")
           @GET
           @Produces(value="application/json")
          public List<RoleRepresentation> getAvailableRealmRoleMappings()

      Get realm-level roles that can be mapped
      Returns:

    - #### addRealmRoleMappings

          @Path(value="realm")
           @POST
           @Consumes(value="application/json")
          public void addRealmRoleMappings(List<RoleRepresentation> roles)

      Add realm-level role mappings to the user
      Parameters:
        `roles` - Roles to add

    - #### deleteRealmRoleMappings

          @Path(value="realm")
           @DELETE
           @Consumes(value="application/json")
          public void deleteRealmRoleMappings(List<RoleRepresentation> roles)

      Delete realm-level role mappings
      Parameters:
        `roles` -

    - #### getUserClientRoleMappingsResource

          @Path(value="clients/{client}")
          public ClientRoleMappingsResource getUserClientRoleMappingsResource(@PathParam(value="client")
                                                                                                              String client)

Copyright © 2016 JBoss by Red Hat. All rights reserved.