forked from Archives/Athou_commafeed
allow admin user removal
This commit is contained in:
@@ -168,8 +168,8 @@ public class AdminREST {
|
|||||||
if (u == null) {
|
if (u == null) {
|
||||||
return Response.status(Status.NOT_FOUND).build();
|
return Response.status(Status.NOT_FOUND).build();
|
||||||
}
|
}
|
||||||
if (CommaFeedApplication.USERNAME_ADMIN.equals(u.getName())) {
|
if (user.getId().equals(u.getId())) {
|
||||||
return Response.status(Status.FORBIDDEN).entity("You cannot delete the admin user.").build();
|
return Response.status(Status.FORBIDDEN).entity("You cannot delete your own user.").build();
|
||||||
}
|
}
|
||||||
userService.unregister(u);
|
userService.unregister(u);
|
||||||
return Response.ok().build();
|
return Response.ok().build();
|
||||||
|
|||||||
Reference in New Issue
Block a user