boolean index = false;
String language = context.getLanguage();
final Metadata metadata = dataMan.updateMetadata(context, id, md, validate, ufo, index, language, ri.changeDate, false);
OperationAllowedRepository repository = context.getBean(OperationAllowedRepository.class);
repository.deleteAllByIdAttribute(OperationAllowedId_.metadataId, Integer.parseInt(id));
addPrivileges(id, params.getPrivileges(), localGroups, dataMan, context, log);
metadata.getCategories().clear();
addCategories(metadata, params.getCategories(), localCateg, context, log, null);
dataMan.flush();