Merge "Remove required access permission to get account username"
This commit is contained in:
@@ -35,10 +35,6 @@ public class GetUsername implements RestReadView<AccountResource> {
|
|||||||
@Override
|
@Override
|
||||||
public String apply(AccountResource rsrc) throws AuthException,
|
public String apply(AccountResource rsrc) throws AuthException,
|
||||||
ResourceNotFoundException {
|
ResourceNotFoundException {
|
||||||
if (self.get() != rsrc.getUser()
|
|
||||||
&& !self.get().getCapabilities().canAdministrateServer()) {
|
|
||||||
throw new AuthException("not allowed to get username");
|
|
||||||
}
|
|
||||||
String username = rsrc.getUser().getAccount().getUserName();
|
String username = rsrc.getUser().getAccount().getUserName();
|
||||||
if (username == null) {
|
if (username == null) {
|
||||||
throw new ResourceNotFoundException();
|
throw new ResourceNotFoundException();
|
||||||
|
|||||||
Reference in New Issue
Block a user