allow admin user removal

This commit is contained in:
Athou
2014-08-11 06:01:49 +02:00
parent 397718fbb4
commit b8cd0b024c

View File

@@ -168,8 +168,8 @@ public class AdminREST {
if (u == null) {
return Response.status(Status.NOT_FOUND).build();
}
if (CommaFeedApplication.USERNAME_ADMIN.equals(u.getName())) {
return Response.status(Status.FORBIDDEN).entity("You cannot delete the admin user.").build();
if (user.getId().equals(u.getId())) {
return Response.status(Status.FORBIDDEN).entity("You cannot delete your own user.").build();
}
userService.unregister(u);
return Response.ok().build();