mirror of https://github.com/apache/cloudstack.git
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:
parent
bc525d2236
commit
c25332fc46
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue