Ident<Property> inheritFrom = x.getInheritFrom();
if (inheritFrom == null) {
return true;
}
Property p = ensureReferent(inheritFrom);
TypePolicy policy = p == null ? null : findTypePolicy(p);
if (policy == null || hasUnroselvedInherits(policy)) {
// Skip for the second pass
unresolved.add(inheritFrom);
return false;
}
// Prevent loops
x.setInheritFrom(null);
/*
* Set up inherited groups. This map is used to allow simple names to refer to the inherit
* groups, unless the group name is overridden by a local declaration.
*/
Map<Ident<SecurityGroup>, GroupDefinition> uniqueNames = mapForIteration();
for (GroupBlock group : policy.getGroups()) {
// Make a copy of the GroupDefinition that prepends the property being inherited from
for (GroupDefinition def : group.getDefinitions()) {
GroupDefinition inherited = new GroupDefinition(def, inheritFrom);
uniqueNames.put(inherited.getName(), inherited);