예제 #1
0
 @TimedResource
 @GET
 @Path("/permissions")
 @Produces(APPLICATION_JSON)
 @ApiOperation(
     value = "List user permissions",
     response = String.class,
     responseContainer = "List")
 @ApiResponses(value = {})
 public Response getCurrentUserPermissions(
     @javax.ws.rs.core.Context final HttpServletRequest request) {
   // The getCurrentUserPermissions takes a TenantContext which is not used because permissions are
   // cross tenants (at this point)
   final TenantContext nullTenantContext = null;
   final Set<Permission> permissions = securityApi.getCurrentUserPermissions(nullTenantContext);
   final List<String> json =
       ImmutableList.<String>copyOf(
           Iterables.<Permission, String>transform(permissions, Functions.toStringFunction()));
   return Response.status(Status.OK).entity(json).build();
 }