Search in sources :

Example 1 with JsonPropertyDescription

use of com.fasterxml.jackson.annotation.JsonPropertyDescription 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();
}
Also used : Role(se.inera.intyg.infra.security.common.model.Role) WebCertUser(se.inera.intyg.webcert.web.service.user.dto.WebCertUser) Path(javax.ws.rs.Path) JsonPropertyDescription(com.fasterxml.jackson.annotation.JsonPropertyDescription) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

JsonPropertyDescription (com.fasterxml.jackson.annotation.JsonPropertyDescription)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 Role (se.inera.intyg.infra.security.common.model.Role)1 WebCertUser (se.inera.intyg.webcert.web.service.user.dto.WebCertUser)1