//Looking for children containers overriding inheritance to also apply the cascade changes
dc.setSQL(selectChildrenContainerWithIndividualPermissionsSQL);
dc.addParam(host.getPermissionId());
idsToUpdate = dc.loadResults();
ContainerAPI containerAPI = APILocator.getContainerAPI();
permission = 0;
if (inheritablePermission != null) {
permission = inheritablePermission.getPermission();
}
for (Map<String, String> idMap : idsToUpdate) {
String id = idMap.get("id");
Permissionable childPermissionable;
try {
childPermissionable = containerAPI.getWorkingContainerById(id, systemUser, false);
} catch (DotSecurityException e) {
Logger.error(PermissionBitFactoryImpl.class, e.getMessage(), e);
throw new DotRuntimeException(e.getMessage(), e);
}
savePermission(new Permission(id, role.getId(), permission, true), childPermissionable);