Class RoleMapperResource
- java.lang.Object
-
- org.keycloak.services.resources.admin.RoleMapperResource
-
public class RoleMapperResource extends Object
Base resource for managing users- Version:
- $Revision: 1 $
- Author:
- Bill Burke, Miguel P. Nunes
-
-
Field Summary
Fields Modifier and Type Field Description protected ClientConnection
clientConnection
protected javax.ws.rs.core.HttpHeaders
headers
protected static org.jboss.logging.Logger
logger
protected AdminPermissionEvaluator.RequirePermissionCheck
managePermission
protected RealmModel
realm
protected KeycloakSession
session
protected AdminPermissionEvaluator.RequirePermissionCheck
viewPermission
-
Constructor Summary
Constructors Constructor Description RoleMapperResource(KeycloakSession session, AdminPermissionEvaluator auth, RoleMapperModel roleMapper, AdminEventBuilder adminEvent, AdminPermissionEvaluator.RequirePermissionCheck manageCheck, AdminPermissionEvaluator.RequirePermissionCheck viewCheck)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRealmRoleMappings(List<RoleRepresentation> roles)
Add realm-level role mappings to the uservoid
deleteRealmRoleMappings(List<RoleRepresentation> roles)
Delete realm-level role mappingsStream<RoleRepresentation>
getAvailableRealmRoleMappings()
Get realm-level roles that can be mappedStream<RoleRepresentation>
getCompositeRealmRoleMappings(boolean briefRepresentation)
Get effective realm-level role mappings This will recurse all composite roles to get the result.Stream<RoleRepresentation>
getRealmRoleMappings()
Get realm-level role mappingsMappingsRepresentation
getRoleMappings()
Get role mappingsClientRoleMappingsResource
getUserClientRoleMappingsResource(String client)
-
-
-
Field Detail
-
logger
protected static final org.jboss.logging.Logger logger
-
realm
protected final RealmModel realm
-
managePermission
protected final AdminPermissionEvaluator.RequirePermissionCheck managePermission
-
viewPermission
protected final AdminPermissionEvaluator.RequirePermissionCheck viewPermission
-
clientConnection
protected final ClientConnection clientConnection
-
session
protected final KeycloakSession session
-
headers
protected final javax.ws.rs.core.HttpHeaders headers
-
-
Constructor Detail
-
RoleMapperResource
public RoleMapperResource(KeycloakSession session, AdminPermissionEvaluator auth, RoleMapperModel roleMapper, AdminEventBuilder adminEvent, AdminPermissionEvaluator.RequirePermissionCheck manageCheck, AdminPermissionEvaluator.RequirePermissionCheck viewCheck)
-
-
Method Detail
-
getRoleMappings
@GET @Produces("application/json") public MappingsRepresentation getRoleMappings()
Get role mappings- Returns:
-
getRealmRoleMappings
@Path("realm") @GET @Produces("application/json") public Stream<RoleRepresentation> getRealmRoleMappings()
Get realm-level role mappings- Returns:
-
getCompositeRealmRoleMappings
@Path("realm/composite") @GET @Produces("application/json") public Stream<RoleRepresentation> getCompositeRealmRoleMappings(@QueryParam("briefRepresentation") @DefaultValue("true") boolean briefRepresentation)
Get effective realm-level role mappings This will recurse all composite roles to get the result.- Parameters:
briefRepresentation
- if false, return roles with their attributes- Returns:
-
getAvailableRealmRoleMappings
@Path("realm/available") @GET @Produces("application/json") public Stream<RoleRepresentation> getAvailableRealmRoleMappings()
Get realm-level roles that can be mapped- Returns:
-
addRealmRoleMappings
@Path("realm") @POST @Consumes("application/json") public void addRealmRoleMappings(List<RoleRepresentation> roles)
Add realm-level role mappings to the user- Parameters:
roles
- Roles to add
-
deleteRealmRoleMappings
@Path("realm") @DELETE @Consumes("application/json") public void deleteRealmRoleMappings(List<RoleRepresentation> roles)
Delete realm-level role mappings- Parameters:
roles
-
-
getUserClientRoleMappingsResource
@Path("clients/{client}") public ClientRoleMappingsResource getUserClientRoleMappingsResource(@PathParam("client") String client)
-
-