Fix more comparisons of current user
Change-Id: I3a7c46dfa705ae6fa088735af7f031a840816957
This commit is contained in:
parent
879c2a53ee
commit
adfefda094
@ -53,7 +53,7 @@ public class DeleteActive implements RestModifyView<AccountResource, Input> {
|
||||
@Override
|
||||
public Response<?> apply(AccountResource rsrc, Input input)
|
||||
throws RestApiException, OrmException, IOException {
|
||||
if (self.get() == rsrc.getUser()) {
|
||||
if (self.get().hasSameAccountId(rsrc.getUser())) {
|
||||
throw new ResourceConflictException("cannot deactivate own account");
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,8 @@ public class Emails
|
||||
@Override
|
||||
public AccountResource.Email parse(AccountResource rsrc, IdString id)
|
||||
throws ResourceNotFoundException {
|
||||
if (self.get() != rsrc.getUser() && !self.get().getCapabilities().canAdministrateServer()) {
|
||||
if (!self.get().hasSameAccountId(rsrc.getUser())
|
||||
&& !self.get().getCapabilities().canAdministrateServer()) {
|
||||
throw new ResourceNotFoundException();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user