public class RoleContainerResource extends RoleResource
| Modifier and Type | Field and Description |
|---|---|
protected AdminPermissionEvaluator |
auth |
protected RoleContainerModel |
roleContainer |
| Constructor and Description |
|---|
RoleContainerResource(KeycloakSession session,
javax.ws.rs.core.UriInfo uriInfo,
RealmModel realm,
AdminPermissionEvaluator auth,
RoleContainerModel roleContainer,
AdminEventBuilder adminEvent) |
| 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(String roleName,
String client)
An app-level roles for the specified app for the role's composite
|
List<GroupRepresentation> |
getGroupsInRole(String roleName,
Integer firstResult,
Integer maxResults,
boolean fullRepresentation)
Return List of Groups that have the specified role name
|
ManagementPermissionReference |
getManagementPermissions(String roleName)
Return object stating whether role Authoirzation permissions have been initialized or not and a reference
|
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
|
List<UserRepresentation> |
getUsersInRole(String roleName,
Integer firstResult,
Integer maxResults)
Return List of Users that have the specified role name
|
ManagementPermissionReference |
setManagementPermissionsEnabled(String roleName,
ManagementPermissionReference ref)
Return object stating whether role Authoirzation permissions have been initialized or not and a reference
|
javax.ws.rs.core.Response |
updateRole(String roleName,
RoleRepresentation rep)
Update a role by name
|
addComposites, deleteComposites, deleteRole, getClientRoleComposites, getRealmRoleComposites, getRole, getRoleComposites, updateRoleprotected AdminPermissionEvaluator auth
protected RoleContainerModel roleContainer
public RoleContainerResource(KeycloakSession session, javax.ws.rs.core.UriInfo uriInfo, RealmModel realm, AdminPermissionEvaluator auth, RoleContainerModel roleContainer, AdminEventBuilder adminEvent)
@GET @Produces(value="application/json") public List<RoleRepresentation> getRoles()
@POST @Consumes(value="application/json") public javax.ws.rs.core.Response createRole(RoleRepresentation rep)
rep - @Path(value="{role-name}")
@GET
@Produces(value="application/json")
public RoleRepresentation getRole(@PathParam(value="role-name")
String roleName)
roleName - role's name (not id!)@Path(value="{role-name}")
@DELETE
public void deleteRole(@PathParam(value="role-name")
String roleName)
roleName - role's name (not id!)@Path(value="{role-name}")
@PUT
@Consumes(value="application/json")
public javax.ws.rs.core.Response updateRole(@PathParam(value="role-name")
String roleName,
RoleRepresentation rep)
roleName - role's name (not id!)rep - @Path(value="{role-name}/composites")
@POST
@Consumes(value="application/json")
public void addComposites(@PathParam(value="role-name")
String roleName,
List<RoleRepresentation> roles)
roleName - role's name (not id!)roles - @Path(value="{role-name}/composites")
@GET
@Produces(value="application/json")
public Set<RoleRepresentation> getRoleComposites(@PathParam(value="role-name")
String roleName)
roleName - role's name (not id!)@Path(value="{role-name}/composites/realm")
@GET
@Produces(value="application/json")
public Set<RoleRepresentation> getRealmRoleComposites(@PathParam(value="role-name")
String roleName)
roleName - role's name (not id!)@Path(value="{role-name}/composites/clients/{client}")
@GET
@Produces(value="application/json")
public Set<RoleRepresentation> getClientRoleComposites(@PathParam(value="role-name")
String roleName,
@PathParam(value="client")
String client)
roleName - role's name (not id!)client - @Path(value="{role-name}/composites")
@DELETE
@Consumes(value="application/json")
public void deleteComposites(@PathParam(value="role-name")
String roleName,
List<RoleRepresentation> roles)
roleName - role's name (not id!)roles - roles to remove@Path(value="{role-name}/management/permissions")
@GET
@Produces(value="application/json")
public ManagementPermissionReference getManagementPermissions(@PathParam(value="role-name")
String roleName)
roleName - @Path(value="{role-name}/management/permissions")
@PUT
@Produces(value="application/json")
@Consumes(value="application/json")
public ManagementPermissionReference setManagementPermissionsEnabled(@PathParam(value="role-name")
String roleName,
ManagementPermissionReference ref)
roleName - @Path(value="{role-name}/users")
@GET
@Produces(value="application/json")
public List<UserRepresentation> getUsersInRole(@PathParam(value="role-name")
String roleName,
@QueryParam(value="first")
Integer firstResult,
@QueryParam(value="max")
Integer maxResults)
roleName - firstResult - maxResults - @Path(value="{role-name}/groups")
@GET
@Produces(value="application/json")
public List<GroupRepresentation> getGroupsInRole(@PathParam(value="role-name")
String roleName,
@QueryParam(value="first")
Integer firstResult,
@QueryParam(value="max")
Integer maxResults,
@QueryParam(value="full") @DefaultValue(value="false")
boolean fullRepresentation)
roleName - firstResult - maxResults - fullRepresentation - if true, return a full representation of the GroupRepresentation objectsCopyright © 2019 JBoss by Red Hat. All rights reserved.