Allow to delegate modify account commands to non administrators
Currently only administrators groups allow to modify accounts. This is impractical on very big installations. Add modify account global capability and allow administrators to optionally delegate this job. Bug: Issue 2786 Change-Id: Icc105c39e76908a075e89ec14921972b91866dd4
This commit is contained in:

committed by
David Pursehouse

parent
e715d2484a
commit
aa49e277a3
@@ -85,7 +85,7 @@ public class CreateEmail implements RestModifyView<AccountResource, Input> {
|
||||
ResourceNotFoundException, OrmException, EmailException,
|
||||
MethodNotAllowedException {
|
||||
if (self.get() != rsrc.getUser()
|
||||
&& !self.get().getCapabilities().canAdministrateServer()) {
|
||||
&& !self.get().getCapabilities().canModifyAccount()) {
|
||||
throw new AuthException("not allowed to add email address");
|
||||
}
|
||||
|
||||
@@ -98,8 +98,8 @@ public class CreateEmail implements RestModifyView<AccountResource, Input> {
|
||||
}
|
||||
|
||||
if (input.noConfirmation
|
||||
&& !self.get().getCapabilities().canAdministrateServer()) {
|
||||
throw new AuthException("must be administrator to use no_confirmation");
|
||||
&& !self.get().getCapabilities().canModifyAccount()) {
|
||||
throw new AuthException("not allowed to use no_confirmation");
|
||||
}
|
||||
|
||||
return apply(rsrc.getUser(), input);
|
||||
|
Reference in New Issue
Block a user