org.keycloak.services.resources.admin

## Class ClientRoleMappingsResource

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

-     public class ClientRoleMappingsResource
      extends Object

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected AdminEventBuilder` | `adminEvent`
    `protected RealmAuth` | `auth`
    `protected ClientModel` | `client`
    `protected static ServicesLogger` | `logger`
    `protected RealmModel` | `realm`
    `protected KeycloakSession` | `session`
    `protected RoleMapperModel` | `user`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientRoleMappingsResource(javax.ws.rs.core.UriInfo uriInfo, KeycloakSession session, RealmModel realm, RealmAuth auth, RoleMapperModel user, ClientModel client, AdminEventBuilder adminEvent)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addClientRoleMapping(List<RoleRepresentation> roles)` Add client-level roles to the user role mapping
    `void` | `deleteClientRoleMapping(List<RoleRepresentation> roles)` Delete client-level roles from user role mapping
    `List<RoleRepresentation>` | `getAvailableClientRoleMappings()` Get available client-level roles that can be mapped to the user
    `static List<RoleRepresentation>` | `getAvailableRoles(RoleMapperModel mapper, Set<RoleModel> available)`
    `List<RoleRepresentation>` | `getClientRoleMappings()` Get client-level role mappings for the user, and the app
    `List<RoleRepresentation>` | `getCompositeClientRoleMappings()` Get effective client-level role mappings This recurses any composite roles

    - ### 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

    - #### session

          protected KeycloakSession session

    - #### realm

          protected RealmModel realm

    - #### auth

          protected RealmAuth auth

    - #### user

          protected RoleMapperModel user

    - #### client

          protected ClientModel client

    - #### adminEvent

          protected AdminEventBuilder adminEvent

  - ### Constructor Detail

    - #### ClientRoleMappingsResource

          public ClientRoleMappingsResource(javax.ws.rs.core.UriInfo uriInfo,
                                            KeycloakSession session,
                                            RealmModel realm,
                                            RealmAuth auth,
                                            RoleMapperModel user,
                                            ClientModel client,
                                            AdminEventBuilder adminEvent)

  - ### Method Detail

    - #### getClientRoleMappings

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

      Get client-level role mappings for the user, and the app
      Returns:

    - #### getCompositeClientRoleMappings

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

      Get effective client-level role mappings This recurses any composite roles
      Returns:

    - #### getAvailableClientRoleMappings

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

      Get available client-level roles that can be mapped to the user
      Returns:

    - #### getAvailableRoles

          public static List<RoleRepresentation> getAvailableRoles(RoleMapperModel mapper,
                                                                   Set<RoleModel> available)

    - #### addClientRoleMapping

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

      Add client-level roles to the user role mapping
      Parameters:
        `roles` -

    - #### deleteClientRoleMapping

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

      Delete client-level roles from user role mapping
      Parameters:
        `roles` -

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