CLOUDSTACK-6429:distinguish the case where caller can see everything and

the case where caller cannot see anything. Also change behavior to
default isRecursive to false if not specified.
This commit is contained in:
Min Chen 2014-04-17 10:46:45 -07:00
parent bc525d2236
commit c25332fc46
2 changed files with 8 additions and 2 deletions

View File

@ -39,8 +39,7 @@ public abstract class BaseListDomainResourcesCmd extends BaseListCmd {
}
public boolean isRecursive() {
// if listAll is true, recursive is not specified, then recursive should default to true.
return recursive == null ? (listAll() ? true : false) : recursive;
return recursive == null ? false : recursive;
}
public Long getDomainId() {

View File

@ -2280,6 +2280,13 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
permittedAccounts.addAll(grantedAccounts);
permittedResources.addAll(grantedResources);
}
if (permittedDomains.isEmpty() && permittedAccounts.isEmpty() & permittedResources.isEmpty()) {
// if at this point, all permitted arrays are empty, that means that caller cannot see anything, we put -1 in permittedAccounts
// to distinguish this case from the case that caller can see everything
permittedAccounts.add(-1L);
}
}
}
}