mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-6501:IAM - DomainAdmin - When listVirtualMachines is used
with listall=true and account and domainId , Vms owned by the account account is not listed.
This commit is contained in:
parent
e811e61ded
commit
2bba381a63
|
|
@ -2283,7 +2283,11 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
|
|||
|
||||
if (accountId != null) {
|
||||
// specific account filter is specified
|
||||
if (grantedAccounts.contains(accountId)) {
|
||||
if (grantedDomains.contains(domainId)) {
|
||||
// the account domain is granted to the caller
|
||||
permittedAccounts.add(accountId);
|
||||
}
|
||||
else if (grantedAccounts.contains(accountId)) {
|
||||
permittedAccounts.add(accountId);
|
||||
} else {
|
||||
//TODO: we should also filter granted resources based on accountId passed.
|
||||
|
|
|
|||
|
|
@ -73,8 +73,8 @@ public class RoleBasedEntityQuerySelector extends AdapterBase implements QuerySe
|
|||
domainId = p.getScopeId();
|
||||
//domainIds.add(p.getScopeId());
|
||||
}
|
||||
domainIds.add(domainId);
|
||||
// add all the domain children from this domain. Like RoleBasedEntityAccessChecker, we made an assumption, if DOMAIN scope is granted, it means that
|
||||
//domainIds.add(domainId);
|
||||
// add all the domain children from this domain (including this domain itself). Like RoleBasedEntityAccessChecker, we made an assumption, if DOMAIN scope is granted, it means that
|
||||
// the whole domain tree is granted access.
|
||||
DomainVO domain = _domainDao.findById(domainId);
|
||||
List<Long> childDomains = _domainDao.getDomainChildrenIds(domain.getPath());
|
||||
|
|
|
|||
Loading…
Reference in New Issue