add function count for admin
This commit is contained in:
parent
8625dd44e7
commit
53eb700afb
@ -77,6 +77,20 @@ public class UsersRessources {
|
|||||||
return responseHttp;
|
return responseHttp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@RolesAllowed("Admin")
|
||||||
|
@Path("count")
|
||||||
|
public Response getCount(@CookieParam("user") String userCookie, @Context SecurityContext ctx){
|
||||||
|
UUID kid = UUID.fromString(jwt.getClaim(Claims.kid));
|
||||||
|
UsersEntity user = UsersEntity.findById(kid);
|
||||||
|
Response.Status status = getResponseCheck(ctx, userCookie, user);
|
||||||
|
Response responseHttp = Response.status(status).build();
|
||||||
|
if (status.equals(Response.Status.OK)){
|
||||||
|
responseHttp = Response.ok(UsersEntity.count()).build();
|
||||||
|
}
|
||||||
|
return responseHttp;
|
||||||
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@RolesAllowed("Admin")
|
@RolesAllowed("Admin")
|
||||||
@Path("{id}")
|
@Path("{id}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user