// changes
dc.setSQL(selectChildrenLinkWithIndividualPermissionsSQL);
dc.addParam(host.getPermissionId());
dc.addParam(isHost ? "%" : folderPath + "%");
idsToUpdate = dc.loadResults();
MenuLinkAPI linkAPI = APILocator.getMenuLinkAPI();
permission = 0;
if (inheritablePermission != null) {
permission = inheritablePermission.getPermission();
}
for (Map<String, String> idMap : idsToUpdate) {
String id = idMap.get("id");
Permissionable childPermissionable;
try {
childPermissionable = linkAPI.findWorkingLinkById(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);