fix query available languages by ordinal

This commit is contained in:
amentis 2024-01-05 16:27:37 +02:00
parent 8807d42121
commit 34df0b640c
2 changed files with 4 additions and 1 deletions

View File

@ -65,7 +65,7 @@ public class NotificationServiceImpl implements NotificationService {
public void persist(NotificationPersist model, FieldSet fields) throws MyForbiddenException, MyValidationException, MyApplicationException, MyNotFoundException, InvalidApplicationException { public void persist(NotificationPersist model, FieldSet fields) throws MyForbiddenException, MyValidationException, MyApplicationException, MyNotFoundException, InvalidApplicationException {
logger.debug(new MapLogEntry("persisting notification").And("model", model).And("fields", fields)); logger.debug(new MapLogEntry("persisting notification").And("model", model).And("fields", fields));
//this.authorizationService.authorizeForce(Permission.AuthenticatedRole); this.authorizationService.authorizeForce(Permission.AuthenticatedRole);
Boolean isUpdate = this.conventionService.isValidGuid(model.getId()); Boolean isUpdate = this.conventionService.isValidGuid(model.getId());

View File

@ -6,6 +6,7 @@ import eu.eudat.authorization.AuthorizationFlags;
import eu.eudat.commons.validation.ValidationFilterAnnotation; import eu.eudat.commons.validation.ValidationFilterAnnotation;
import eu.eudat.data.LanguageEntity; import eu.eudat.data.LanguageEntity;
import eu.eudat.model.Language; import eu.eudat.model.Language;
import eu.eudat.model.UserContactInfo;
import eu.eudat.model.builder.LanguageBuilder; import eu.eudat.model.builder.LanguageBuilder;
import eu.eudat.model.censorship.LanguageCensor; import eu.eudat.model.censorship.LanguageCensor;
import eu.eudat.model.persist.LanguagePersist; import eu.eudat.model.persist.LanguagePersist;
@ -16,6 +17,7 @@ import eu.eudat.service.language.LanguageService;
import gr.cite.tools.auditing.AuditService; import gr.cite.tools.auditing.AuditService;
import gr.cite.tools.data.builder.BuilderFactory; import gr.cite.tools.data.builder.BuilderFactory;
import gr.cite.tools.data.censor.CensorFactory; import gr.cite.tools.data.censor.CensorFactory;
import gr.cite.tools.data.query.Ordering;
import gr.cite.tools.data.query.QueryFactory; import gr.cite.tools.data.query.QueryFactory;
import gr.cite.tools.exception.MyApplicationException; import gr.cite.tools.exception.MyApplicationException;
import gr.cite.tools.exception.MyForbiddenException; import gr.cite.tools.exception.MyForbiddenException;
@ -138,6 +140,7 @@ public class LanguageController {
this.censorFactory.censor(LanguageCensor.class).censor(lookup.getProject(), null); this.censorFactory.censor(LanguageCensor.class).censor(lookup.getProject(), null);
LanguageQuery query = lookup.enrich(this.queryFactory).authorize(AuthorizationFlags.OwnerOrDmpAssociatedOrPermissionOrPublic); LanguageQuery query = lookup.enrich(this.queryFactory).authorize(AuthorizationFlags.OwnerOrDmpAssociatedOrPermissionOrPublic);
query.setOrder(new Ordering().addAscending(Language._ordinal));
List<LanguageEntity> data = query.collectAs(lookup.getProject()); List<LanguageEntity> data = query.collectAs(lookup.getProject());
List<Language> models = this.builderFactory.builder(LanguageBuilder.class).authorize(AuthorizationFlags.OwnerOrDmpAssociatedOrPermissionOrPublic).build(lookup.getProject(), data); List<Language> models = this.builderFactory.builder(LanguageBuilder.class).authorize(AuthorizationFlags.OwnerOrDmpAssociatedOrPermissionOrPublic).build(lookup.getProject(), data);