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(javax.ws.rs.core.UriInfo uriInfo, RealmModel realm, RealmAuth auth, RoleContainerModel roleContainer, AdminEventBuilder adminEvent)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addComposites(String roleName, List<RoleRepresentation> roles)` Add a composite to the role
    `javax.ws.rs.core.Response` | `createRole(RoleRepresentation rep)` Create a new role for the realm or client
    `void` | `deleteComposites(String roleName, List<RoleRepresentation> roles)` Remove roles from the role's composite
    `void` | `deleteRole(String roleName)` Delete a role by name
    `Set<RoleRepresentation>` | `getClientRoleComposites(javax.ws.rs.core.UriInfo uriInfo, String roleName, String client)` An app-level roles for the specified app for the role's composite
    `Set<RoleRepresentation>` | `getRealmRoleComposites(String roleName)` Get realm-level roles of the role's composite
    `RoleRepresentation` | `getRole(String roleName)` Get a role by name
    `Set<RoleRepresentation>` | `getRoleComposites(String roleName)` Get composites of the role
    `List<RoleRepresentation>` | `getRoles()` Get all roles for the realm or client
    `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, getClientRoleComposites, 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(javax.ws.rs.core.UriInfo uriInfo,
                                       RealmModel realm,
                                       RealmAuth auth,
                                       RoleContainerModel roleContainer,
                                       AdminEventBuilder adminEvent)

  - ### Method Detail

    - #### getRoles

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

      Get all roles for the realm or client
      Returns:

    - #### createRole

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

      Create a new role for the realm or client
      Parameters:
        `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 the 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)

      Get composites of the 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 the role's composite
      Parameters:
        `roleName` - role's name (not id!)
      Returns:

    - #### getClientRoleComposites

          @Path(value="{role-name}/composites/clients/{client}")
           @GET
           @Produces(value="application/json")
          public Set<RoleRepresentation> getClientRoleComposites(@Context
                                                                                                                                                                   javax.ws.rs.core.UriInfo uriInfo,
                                                                                                                                                                   @PathParam(value="role-name")
                                                                                                                                                                   String roleName,
                                                                                                                                                                   @PathParam(value="client")
                                                                                                                                                                   String client)

      An app-level roles for the specified app for the role's composite
      Parameters:
        `roleName` - role's name (not id!)
        `client` -
      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 the role's composite
      Parameters:
        `roleName` - role's name (not id!)
        `roles` - roles to remove

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