org.keycloak.services.resources.admin

## Class UserApplicationRoleMappingsResource

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

-     public class UserApplicationRoleMappingsResource
      extends Object

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ApplicationModel` | `application`
    `protected RealmAuth` | `auth`
    `protected static org.jboss.logging.Logger` | `logger`
    `protected RealmModel` | `realm`
    `protected UserModel` | `user`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UserApplicationRoleMappingsResource(RealmModel realm, RealmAuth auth, UserModel user, ApplicationModel application)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addApplicationRoleMapping(List<RoleRepresentation> roles)` Add application-level roles to the user role mapping.
    `void` | `deleteApplicationRoleMapping(List<RoleRepresentation> roles)` Delete application-level roles from user role mapping.
    `List<RoleRepresentation>` | `getApplicationRoleMappings()` Get application-level role mappings for this user for a specific app
    `List<RoleRepresentation>` | `getAvailableApplicationRoleMappings()` Get available application-level roles that can be mapped to the user
    `static List<RoleRepresentation>` | `getAvailableRoles(UserModel user, Set<RoleModel> available)`
    `List<RoleRepresentation>` | `getCompositeApplicationRoleMappings()` Get effective application-level role mappings.

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

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

- - ### Field Detail

    - #### logger

          protected static final org.jboss.logging.Logger logger

    - #### realm

          protected RealmModel realm

    - #### auth

          protected RealmAuth auth

    - #### user

          protected UserModel user

    - #### application

          protected ApplicationModel application

  - ### Constructor Detail

    - #### UserApplicationRoleMappingsResource

          public UserApplicationRoleMappingsResource(RealmModel realm,
                                             RealmAuth auth,
                                             UserModel user,
                                             ApplicationModel application)

  - ### Method Detail

    - #### getApplicationRoleMappings

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

      Get application-level role mappings for this user for a specific app
      Returns:

    - #### getCompositeApplicationRoleMappings

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

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

    - #### getAvailableApplicationRoleMappings

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

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

    - #### getAvailableRoles

          public static List<RoleRepresentation> getAvailableRoles(UserModel user,
                                                   Set<RoleModel> available)

    - #### addApplicationRoleMapping

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

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

    - #### deleteApplicationRoleMapping

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

      Delete application-level roles from user role mapping.
      Parameters:
        `roles` -

Copyright © 2015. All rights reserved.