use of com.google.gerrit.server.account.CreateAccount in project gerrit by GerritCodeReview.
the class AccountsImpl method create.
@Override
public AccountApi create(AccountInput in) throws RestApiException {
if (checkNotNull(in, "AccountInput").username == null) {
throw new BadRequestException("AccountInput must specify username");
}
try {
CreateAccount impl = createAccount.create(in.username);
permissionBackend.user(self).checkAny(GlobalPermission.fromAnnotation(impl.getClass()));
AccountInfo info = impl.apply(TopLevelResource.INSTANCE, in).value();
return id(info._accountId);
} catch (Exception e) {
throw asRestApiException("Cannot create account " + in.username, e);
}
}
Aggregations