org.keycloak.services.resources.admin

## Class ScopeMappedResource

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

-     public class ScopeMappedResource
      extends Object

  Base class for managing the scope mappings of a specific client.
  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected AdminEventBuilder` | `adminEvent`
    `protected RealmModel` | `realm`
    `protected ScopeContainerModel` | `scopeContainer`
    `protected KeycloakSession` | `session`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ScopeMappedResource(RealmModel realm, RealmAuth auth, ScopeContainerModel scopeContainer, KeycloakSession session, AdminEventBuilder adminEvent)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRealmScopeMappings(List<RoleRepresentation> roles)` Add a set of realm-level roles to the client's scope
    `void` | `deleteRealmScopeMappings(List<RoleRepresentation> roles)` Remove a set of realm-level roles from the client's scope
    `static List<RoleRepresentation>` | `getAvailable(ScopeContainerModel client, Set<RoleModel> roles)`
    `List<RoleRepresentation>` | `getAvailableRealmScopeMappings()` Get realm-level roles that are available to attach to this client's scope
    `ScopeMappedClientResource` | `getClientByIdScopeMappings(String client)`
    `static List<RoleRepresentation>` | `getComposite(ScopeContainerModel client, Set<RoleModel> roles)`
    `List<RoleRepresentation>` | `getCompositeRealmScopeMappings()` Get effective realm-level roles associated with the client's scope What this does is recurse any composite roles associated with the client's scope and adds the roles to this lists.
    `List<RoleRepresentation>` | `getRealmScopeMappings()` Get realm-level roles associated with the client's scope
    `MappingsRepresentation` | `getScopeMappings()` Get all scope mappings for the client

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

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

- - ### Field Detail

    - #### realm

          protected RealmModel realm

    - #### scopeContainer

          protected ScopeContainerModel scopeContainer

    - #### session

          protected KeycloakSession session

    - #### adminEvent

          protected AdminEventBuilder adminEvent

  - ### Constructor Detail

    - #### ScopeMappedResource

          public ScopeMappedResource(RealmModel realm,
                                     RealmAuth auth,
                                     ScopeContainerModel scopeContainer,
                                     KeycloakSession session,
                                     AdminEventBuilder adminEvent)

  - ### Method Detail

    - #### getScopeMappings

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

      Get all scope mappings for the client
      Returns:

    - #### getRealmScopeMappings

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

      Get realm-level roles associated with the client's scope
      Returns:

    - #### getAvailableRealmScopeMappings

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

      Get realm-level roles that are available to attach to this client's scope
      Returns:

    - #### getAvailable

          public static List<RoleRepresentation> getAvailable(ScopeContainerModel client,
                                                              Set<RoleModel> roles)

    - #### getCompositeRealmScopeMappings

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

      Get effective realm-level roles associated with the client's scope What this does is recurse any composite roles associated with the client's scope and adds the roles to this lists. The method is really to show a comprehensive total view of realm-level roles associated with the client.
      Returns:

    - #### getComposite

          public static List<RoleRepresentation> getComposite(ScopeContainerModel client,
                                                              Set<RoleModel> roles)

    - #### addRealmScopeMappings

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

      Add a set of realm-level roles to the client's scope
      Parameters:
        `roles` -

    - #### deleteRealmScopeMappings

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

      Remove a set of realm-level roles from the client's scope
      Parameters:
        `roles` -

    - #### getClientByIdScopeMappings

          @Path(value="clients/{client}")
          public ScopeMappedClientResource getClientByIdScopeMappings(@PathParam(value="client")
                                                                                                      String client)

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