use of se.inera.intyg.infra.security.common.model.Role in project webcert by sklintyg.
the class GrpSignaturServiceTest method createUser.
private WebCertUser createUser() {
Role role = AUTHORITIES_RESOLVER.getRole(AuthoritiesConstants.ROLE_LAKARE);
WebCertUser user = new WebCertUser();
user.setRoles(AuthoritiesResolverUtil.toMap(role));
user.setAuthorities(AuthoritiesResolverUtil.toMap(role.getPrivileges(), Privilege::getName));
return user;
}
use of se.inera.intyg.infra.security.common.model.Role in project webcert by sklintyg.
the class UserResource method getUserRoles.
@GET
@Path("/role")
@Produces(MediaType.APPLICATION_JSON)
@JsonPropertyDescription("Get the roles for user in session")
public Response getUserRoles() {
final WebCertUser user = webCertUserService.getUser();
final Map<String, Role> roles = user.getRoles();
final Set<String> roleStrings = roles.keySet();
return Response.ok(roleStrings).build();
}
Aggregations