Class RoleMapperResource
java.lang.Object
org.keycloak.services.resources.admin.RoleMapperResource
Base resource for managing users
- Version:
- $Revision: 1 $
- Author:
- Bill Burke, Miguel P. Nunes
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ClientConnection
protected final jakarta.ws.rs.core.HttpHeaders
protected static final org.jboss.logging.Logger
protected final AdminPermissionEvaluator.RequirePermissionCheck
protected final RealmModel
protected final KeycloakSession
protected final AdminPermissionEvaluator.RequirePermissionCheck
-
Constructor Summary
ConstructorDescriptionRoleMapperResource
(KeycloakSession session, AdminPermissionEvaluator auth, RoleMapperModel roleMapper, AdminEventBuilder adminEvent, AdminPermissionEvaluator.RequirePermissionCheck manageCheck, AdminPermissionEvaluator.RequirePermissionCheck viewCheck) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add realm-level role mappings to the uservoid
Delete realm-level role mappingsGet realm-level roles that can be mappedgetCompositeRealmRoleMappings
(boolean briefRepresentation) Get effective realm-level role mappings This will recurse all composite roles to get the result.Get realm-level role mappingsGet role mappings
-
Field Details
-
logger
protected static final org.jboss.logging.Logger logger -
realm
-
managePermission
-
viewPermission
-
clientConnection
-
session
-
headers
protected final jakarta.ws.rs.core.HttpHeaders headers
-
-
Constructor Details
-
RoleMapperResource
public RoleMapperResource(KeycloakSession session, AdminPermissionEvaluator auth, RoleMapperModel roleMapper, AdminEventBuilder adminEvent, AdminPermissionEvaluator.RequirePermissionCheck manageCheck, AdminPermissionEvaluator.RequirePermissionCheck viewCheck)
-
-
Method Details
-
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-id}") public ClientRoleMappingsResource getUserClientRoleMappingsResource(@PathParam("client-id") String client)
-