Class RoleByIdResource
- java.lang.Object
- 
- org.keycloak.services.resources.admin.RoleResource
- 
- org.keycloak.services.resources.admin.RoleByIdResource
 
 
- 
 public class RoleByIdResource extends RoleResource Sometimes its easier to just interact with roles by their ID instead of container/role-name- Version:
- $Revision: 1 $
- Author:
- Bill Burke
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected static org.jboss.logging.Loggerlogger
 - 
Constructor SummaryConstructors Constructor Description RoleByIdResource(KeycloakSession session, AdminPermissionEvaluator auth, AdminEventBuilder adminEvent)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddComposites(String id, List<RoleRepresentation> roles)Make the role a composite role by associating some child rolesvoiddeleteComposites(String id, List<RoleRepresentation> roles)Remove a set of roles from the role's compositevoiddeleteRole(String id)Delete the roleStream<RoleRepresentation>getClientRoleComposites(String id, String clientUuid)Get client-level roles for the client that are in the role's compositeManagementPermissionReferencegetManagementPermissions(String id)Return object stating whether role Authoirzation permissions have been initialized or not and a referenceStream<RoleRepresentation>getRealmRoleComposites(String id)Get realm-level roles that are in the role's compositeRoleRepresentationgetRole(String id)Get a specific role's representationStream<RoleRepresentation>getRoleComposites(String id, String search, Integer first, Integer max)Get role's children Returns a set of role's children provided the role is a composite.protected RoleModelgetRoleModel(String id)ManagementPermissionReferencesetManagementPermissionsEnabled(String id, ManagementPermissionReference ref)Return object stating whether role Authoirzation permissions have been initialized or not and a referencestatic ManagementPermissionReferencetoMgmtRef(RoleModel role, AdminPermissionManagement permissions)voidupdateRole(String id, RoleRepresentation rep)Update the role- 
Methods inherited from class org.keycloak.services.resources.admin.RoleResourceaddComposites, deleteComposites, deleteRole, getClientRoleComposites, getRealmRoleComposites, getRole, updateRole
 
- 
 
- 
- 
- 
Constructor Detail- 
RoleByIdResourcepublic RoleByIdResource(KeycloakSession session, AdminPermissionEvaluator auth, AdminEventBuilder adminEvent) 
 
- 
 - 
Method Detail- 
getRole@Path("{role-id}") @GET @Produces("application/json") public RoleRepresentation getRole(@PathParam("role-id") String id)Get a specific role's representation- Parameters:
- id- id of role
- Returns:
 
 - 
deleteRole@Path("{role-id}") @DELETE public void deleteRole(@PathParam("role-id") String id)Delete the role- Parameters:
- id- id of role
 
 - 
updateRole@Path("{role-id}") @PUT @Consumes("application/json") public void updateRole(@PathParam("role-id") String id, RoleRepresentation rep)Update the role- Parameters:
- id- id of role
- rep-
 
 - 
addComposites@Path("{role-id}/composites") @POST @Consumes("application/json") public void addComposites(@PathParam("role-id") String id, List<RoleRepresentation> roles)Make the role a composite role by associating some child roles- Parameters:
- id-
- roles-
 
 - 
getRoleComposites@Path("{role-id}/composites") @GET @Produces("application/json") public Stream<RoleRepresentation> getRoleComposites(@PathParam("role-id") String id, @QueryParam("search") String search, @QueryParam("first") Integer first, @QueryParam("max") Integer max)Get role's children Returns a set of role's children provided the role is a composite.- Parameters:
- id-
- Returns:
 
 - 
getRealmRoleComposites@Path("{role-id}/composites/realm") @GET @Produces("application/json") public Stream<RoleRepresentation> getRealmRoleComposites(@PathParam("role-id") String id)Get realm-level roles that are in the role's composite- Parameters:
- id-
- Returns:
 
 - 
getClientRoleComposites@Path("{role-id}/composites/clients/{clientUuid}") @GET @Produces("application/json") public Stream<RoleRepresentation> getClientRoleComposites(@PathParam("role-id") String id, @PathParam("clientUuid") String clientUuid)Get client-level roles for the client that are in the role's composite- Parameters:
- id-
- clientUuid-
- Returns:
 
 - 
deleteComposites@Path("{role-id}/composites") @DELETE @Consumes("application/json") public void deleteComposites(@PathParam("role-id") String id, List<RoleRepresentation> roles)Remove a set of roles from the role's composite- Parameters:
- id- Role id
- roles- A set of roles to be removed
 
 - 
getManagementPermissions@Path("{role-id}/management/permissions") @GET @Produces("application/json") public ManagementPermissionReference getManagementPermissions(@PathParam("role-id") String id)Return object stating whether role Authoirzation permissions have been initialized or not and a reference- Parameters:
- id-
- Returns:
 
 - 
toMgmtRefpublic static ManagementPermissionReference toMgmtRef(RoleModel role, AdminPermissionManagement permissions) 
 - 
setManagementPermissionsEnabled@Path("{role-id}/management/permissions") @PUT @Produces("application/json") @Consumes("application/json") public ManagementPermissionReference setManagementPermissionsEnabled(@PathParam("role-id") String id, ManagementPermissionReference ref)Return object stating whether role Authoirzation permissions have been initialized or not and a reference- Parameters:
- id-
- Returns:
- initialized manage permissions reference
 
 
- 
 
-