mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Handle scopeId=-1 properly, which indicates current caller domain or
account.
This commit is contained in:
parent
0b5b861994
commit
63e42d3c47
@ -50,7 +50,11 @@ public class RoleBasedEntityQuerySelector extends AdapterBase implements QuerySe
|
||||
if (pp != null) {
|
||||
for (AclPolicyPermission p : pp) {
|
||||
if (p.getScopeId() != null) {
|
||||
domainIds.add(p.getScopeId());
|
||||
if (p.getScopeId().longValue() == -1) {
|
||||
domainIds.add(caller.getDomainId());
|
||||
} else {
|
||||
domainIds.add(p.getScopeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -70,7 +74,11 @@ public class RoleBasedEntityQuerySelector extends AdapterBase implements QuerySe
|
||||
if (pp != null) {
|
||||
for (AclPolicyPermission p : pp) {
|
||||
if (p.getScopeId() != null) {
|
||||
accountIds.add(p.getScopeId());
|
||||
if (p.getScopeId().longValue() == -1) {
|
||||
accountIds.add(caller.getId());
|
||||
} else {
|
||||
accountIds.add(p.getScopeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user