Search in sources :

Example 1 with UserRolesJson

use of org.killbill.billing.jaxrs.json.UserRolesJson in project killbill by killbill.

the class SecurityResource method getUserRoles.

@TimedResource
@GET
@Produces(APPLICATION_JSON)
@Path("/users/{username:" + ANYTHING_PATTERN + "}/roles")
@ApiOperation(value = "Get roles associated to a user")
public Response getUserRoles(@PathParam("username") final String username, @javax.ws.rs.core.Context final HttpServletRequest request, @javax.ws.rs.core.Context final UriInfo uriInfo) throws SecurityApiException {
    final List<String> roles = securityApi.getUserRoles(username, context.createContext(request));
    final UserRolesJson userRolesJson = new UserRolesJson(username, null, roles);
    return Response.status(Status.OK).entity(userRolesJson).build();
}
Also used : UserRolesJson(org.killbill.billing.jaxrs.json.UserRolesJson) Path(javax.ws.rs.Path) TimedResource(org.killbill.commons.metrics.TimedResource) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) ApiOperation(io.swagger.annotations.ApiOperation)

Aggregations

ApiOperation (io.swagger.annotations.ApiOperation)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 UserRolesJson (org.killbill.billing.jaxrs.json.UserRolesJson)1 TimedResource (org.killbill.commons.metrics.TimedResource)1