bug 6450: list all snapshot for admin

status 6450: resolved fixed
This commit is contained in:
anthony 2010-10-07 15:33:58 -07:00
parent e1513645a0
commit e6b1add27f
1 changed files with 7 additions and 10 deletions

View File

@ -87,16 +87,13 @@ public class ListSnapshotsCmd extends BaseCmd {
}
Long accountId = null;
if ((account == null) || isAdmin(account.getType())) {
if(account != null && account.getType() == Account.ACCOUNT_TYPE_DOMAIN_ADMIN)
accountId = account.getId();
if (account == null) {
if (domainId != null && accountName != null) {
Account userAccount = getManagementServer().findAccountByName(accountName, domainId);
if (userAccount != null) {
accountId = userAccount.getId();
}
account = getManagementServer().findAccountByName(accountName, domainId);
}
} else {
}
if( account != null && !isAdmin(account.getType())) {
accountId = account.getId();
}
@ -118,8 +115,8 @@ public class ListSnapshotsCmd extends BaseCmd {
c.addCriteria(Criteria.NAME, name);
c.addCriteria(Criteria.ID, id);
c.addCriteria(Criteria.KEYWORD, keyword);
c.addCriteria(Criteria.ACCOUNTID, accountId);
c.addCriteria(Criteria.ACCOUNTID, accountId);
List<SnapshotVO> snapshots = null;
try {
snapshots = getManagementServer().listSnapshots(c, interval);