org.keycloak.services.resources.admin

## Class RoleContainerResource

- java.lang.Object
- - org.keycloak.services.resources.admin.RoleResource
  - - org.keycloak.services.resources.admin.RoleContainerResource

-     public class RoleContainerResource
      extends RoleResource

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected RoleContainerModel` | `roleContainer`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RoleContainerResource(RealmModel realm, RealmAuth auth, RoleContainerModel roleContainer)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addComposites(String roleName, List<RoleRepresentation> roles)` Add a composite to this role
    `javax.ws.rs.core.Response` | `createRole(javax.ws.rs.core.UriInfo uriInfo, RoleRepresentation rep)` Create a new role for this realm or application
    `void` | `deleteComposites(String roleName, List<RoleRepresentation> roles)` Remove roles from this role's composite
    `void` | `deleteRole(String roleName)` Delete a role by name
    `Set<RoleRepresentation>` | `getApplicationByIdRoleComposites(String roleName, String appId)` An app-level roles for a specific app for this role's composite
    `Set<RoleRepresentation>` | `getApplicationRoleComposites(String roleName, String appName)` An app-level roles for a specific app for this role's composite
    `Set<RoleRepresentation>` | `getRealmRoleComposites(String roleName)` Get realm-level roles of this role's composite
    `RoleRepresentation` | `getRole(String roleName)` Get a role by name
    `Set<RoleRepresentation>` | `getRoleComposites(String roleName)` List composites of this role
    `List<RoleRepresentation>` | `getRoles()` List all roles for this realm or application
    `javax.ws.rs.core.Response` | `updateRole(String roleName, RoleRepresentation rep)` Update a role by name

    - ### Methods inherited from class org.keycloak.services.resources.admin.RoleResource

      `addComposites, deleteComposites, deleteRole, getApplicationRoleComposites, getRealmRoleComposites, getRole, getRoleComposites, updateRole`

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

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

- - ### Field Detail

    - #### roleContainer

          protected RoleContainerModel roleContainer

  - ### Constructor Detail

    - #### RoleContainerResource

          public RoleContainerResource(RealmModel realm,
                               RealmAuth auth,
                               RoleContainerModel roleContainer)

  - ### Method Detail

    - #### getRoles

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

      List all roles for this realm or application
      Returns:

    - #### createRole

          @POST
          @Consumes(value="application/json")
          public javax.ws.rs.core.Response createRole(@Context
                                                           javax.ws.rs.core.UriInfo uriInfo,
                                                           RoleRepresentation rep)

      Create a new role for this realm or application
      Parameters:
        `uriInfo` -
        `rep` -
      Returns:

    - #### getRole

          @Path(value="{role-name}")
          @GET
          @Produces(value="application/json")
          public RoleRepresentation getRole(@PathParam(value="role-name")
                                                     String roleName)

      Get a role by name
      Parameters:
        `roleName` - role's name (not id!)
      Returns:

    - #### deleteRole

          @Path(value="{role-name}")
          @DELETE
          public void deleteRole(@PathParam(value="role-name")
                                    String roleName)

      Delete a role by name
      Parameters:
        `roleName` - role's name (not id!)

    - #### updateRole

          @Path(value="{role-name}")
          @PUT
          @Consumes(value="application/json")
          public javax.ws.rs.core.Response updateRole(@PathParam(value="role-name")
                                                               String roleName,
                                                               RoleRepresentation rep)

      Update a role by name
      Parameters:
        `roleName` - role's name (not id!)
        `rep` -
      Returns:

    - #### addComposites

          @Path(value="{role-name}/composites")
          @POST
          @Consumes(value="application/json")
          public void addComposites(@PathParam(value="role-name")
                                              String roleName,
                                              List<RoleRepresentation> roles)

      Add a composite to this role
      Parameters:
        `roleName` - role's name (not id!)
        `roles` -

    - #### getRoleComposites

          @Path(value="{role-name}/composites")
          @GET
          @Produces(value="application/json")
          public Set<RoleRepresentation> getRoleComposites(@PathParam(value="role-name")
                                                                    String roleName)

      List composites of this role
      Parameters:
        `roleName` - role's name (not id!)
      Returns:

    - #### getRealmRoleComposites

          @Path(value="{role-name}/composites/realm")
          @GET
          @Produces(value="application/json")
          public Set<RoleRepresentation> getRealmRoleComposites(@PathParam(value="role-name")
                                                                         String roleName)

      Get realm-level roles of this role's composite
      Parameters:
        `roleName` - role's name (not id!)
      Returns:

    - #### getApplicationRoleComposites

          @Path(value="{role-name}/composites/application/{app}")
          @GET
          @Produces(value="application/json")
          public Set<RoleRepresentation> getApplicationRoleComposites(@PathParam(value="role-name")
                                                                               String roleName,
                                                                               @PathParam(value="app")
                                                                               String appName)

      An app-level roles for a specific app for this role's composite
      Parameters:
        `roleName` - role's name (not id!)
        `appName` -
      Returns:

    - #### getApplicationByIdRoleComposites

          @Path(value="{role-name}/composites/application-by-id/{appId}")
          @GET
          @Produces(value="application/json")
          public Set<RoleRepresentation> getApplicationByIdRoleComposites(@PathParam(value="role-name")
                                                                                   String roleName,
                                                                                   @PathParam(value="appId")
                                                                                   String appId)

      An app-level roles for a specific app for this role's composite
      Parameters:
        `roleName` - role's name (not id!)
        `appId` -
      Returns:

    - #### deleteComposites

          @Path(value="{role-name}/composites")
          @DELETE
          @Consumes(value="application/json")
          public void deleteComposites(@PathParam(value="role-name")
                                                   String roleName,
                                                   List<RoleRepresentation> roles)

      Remove roles from this role's composite
      Parameters:
        `roleName` - role's name (not id!)
        `roles` - roles to remove

Copyright © 2014. All Rights Reserved.