AccountDetailInfo: Include flag if account is inactive

It's annoying that the account GetDetail REST endpoint tells you all
about the account, but not if it's active or not, and that this
information has to be retrieved by calling another REST endpoint.

Change-Id: Ie09297c9bd2da91b3f6d6fd5718f35d0b0a307b0
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2017-06-29 12:02:41 +02:00
parent 30446b1921
commit 58f6a7e80b
2 changed files with 4 additions and 0 deletions

View File

@@ -42,6 +42,7 @@ public class GetDetail implements RestReadView<AccountResource> {
Account a = rsrc.getUser().getAccount();
AccountDetailInfo info = new AccountDetailInfo(a.getId().get());
info.registeredOn = a.getRegisteredOn();
info.inactive = !a.isActive() ? true : null;
try {
directory.fillAccountInfo(Collections.singleton(info), EnumSet.allOf(FillOptions.class));
} catch (DirectoryException e) {
@@ -53,6 +54,7 @@ public class GetDetail implements RestReadView<AccountResource> {
public static class AccountDetailInfo extends AccountInfo {
public Timestamp registeredOn;
public Boolean inactive;
public AccountDetailInfo(Integer id) {
super(id);