Small fix

This commit is contained in:
Thomas Georgios Giannos 2023-11-13 17:05:25 +02:00
parent 5edaf1c74e
commit d50a058296
1 changed files with 8 additions and 2 deletions

View File

@ -316,7 +316,10 @@ public class DmpServiceImpl implements DmpService {
public List<DmpUserEntity> assignUsers(UUID dmp, List<DmpUserPersist> model, FieldSet fieldSet) throws InvalidApplicationException {
this.authorizationService.authorizeForce(Permission.AssignDmpUsers);
List<DmpUserEntity> existingUsers = this.queryFactory.query(DmpUserQuery.class).dmpIds(dmp).collect();
List<DmpUserEntity> existingUsers = this.queryFactory.query(DmpUserQuery.class)
.dmpIds(dmp)
.isActives(IsActive.Active)
.collect();
for (DmpUserPersist dmpUser : model) {
if (checkUserRoleIfExists(existingUsers, dmp, dmpUser.getUser(), dmpUser.getRole()))
@ -340,7 +343,10 @@ public class DmpServiceImpl implements DmpService {
this.entityManager.flush();
return this.queryFactory.query(DmpUserQuery.class).dmpIds().collect();
return this.queryFactory.query(DmpUserQuery.class)
.dmpIds(dmp)
.isActives(IsActive.Active)
.collect();
}
private DmpEntity patchAndSave(DmpPersist model) throws JsonProcessingException, InvalidApplicationException {