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
|
Stream<RoleRepresentation> |
getClientRoleComposites(String roleName,
String clientUuid)
Get client-level roles for the client that are in the role's composite
|
Stream<GroupRepresentation> |
getGroupsInRole(String roleName,
Integer firstResult,
Integer maxResults,
boolean briefRepresentation)
Returns a stream of groups that have the specified role name
|
ManagementPermissionReference |
getManagementPermissions(String roleName)
Return object stating whether role Authorization permissions have been initialized or not and a reference
|
Stream<RoleRepresentation> |
getRealmRoleComposites(String roleName)
Get realm-level roles of the role's composite
|
RoleRepresentation |
getRole(String roleName)
Get a role by name
|
Stream<RoleRepresentation> |
getRoleComposites(String roleName)
Get composites of the role
|
Stream<RoleRepresentation> |
getRoles(String search,
Integer firstResult,
Integer maxResults,
boolean briefRepresentation)
Get all roles for the realm or client
|
Stream<UserRepresentation> |
getUsersInRole(String roleName,
Integer firstResult,
Integer maxResults)
Returns a stream of users that have the specified role name.
|
ManagementPermissionReference |
setManagementPermissionsEnabled(String roleName,
ManagementPermissionReference ref)
Return object stating whether role Authorization 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, 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 Stream<RoleRepresentation> getRoles(@QueryParam(value="search") @DefaultValue(value="") String search, @QueryParam(value="first") Integer firstResult, @QueryParam(value="max") Integer maxResults, @QueryParam(value="briefRepresentation") @DefaultValue(value="true") boolean briefRepresentation)
@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 Stream<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 Stream<RoleRepresentation> getRealmRoleComposites(@PathParam(value="role-name")
String roleName)
roleName - role's name (not id!)@Path(value="{role-name}/composites/clients/{clientUuid}")
@GET
@Produces(value="application/json")
public Stream<RoleRepresentation> getClientRoleComposites(@PathParam(value="role-name")
String roleName,
@PathParam(value="clientUuid")
String clientUuid)
roleName - role's name (not id!)clientUuid - @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 Stream<UserRepresentation> getUsersInRole(@PathParam(value="role-name")
String roleName,
@QueryParam(value="first")
Integer firstResult,
@QueryParam(value="max")
Integer maxResults)
roleName - the role name.firstResult - first result to return. Ignored if negative or null.maxResults - maximum number of results to return. Ignored if negative or null.Stream of users.@Path(value="{role-name}/groups")
@GET
@Produces(value="application/json")
public Stream<GroupRepresentation> getGroupsInRole(@PathParam(value="role-name")
String roleName,
@QueryParam(value="first")
Integer firstResult,
@QueryParam(value="max")
Integer maxResults,
@QueryParam(value="briefRepresentation") @DefaultValue(value="true")
boolean briefRepresentation)
roleName - the role name.firstResult - first result to return. Ignored if negative or null.maxResults - maximum number of results to return. Ignored if negative or null.briefRepresentation - if false, return a full representation of the GroupRepresentation objects.Stream of groups.Copyright © 2021 JBoss by Red Hat. All rights reserved.