From 2f045e6a52fe61b7a7a28a7bf646eb1d7f17c809 Mon Sep 17 00:00:00 2001 From: gkolokythas Date: Wed, 29 May 2019 18:04:20 +0300 Subject: [PATCH] Makes DMP owner to only have the permision to delete members. --- .../eu/eudat/logic/managers/DataManagementPlanManager.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java index dcd654475..757b356b7 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java @@ -413,9 +413,8 @@ public class DataManagementPlanManager { createProjectIfItDoesntExist(newDmp, apiContext.getOperationsContext().getDatabaseRepository().getProjectDao(), user); newDmp.setCreator(user); - if (user.getId().equals(principal.getId())) { - - DMP dmp = apiContext.getOperationsContext().getDatabaseRepository().getDmpDao().find(dataManagementPlan.getId()); + DMP dmp = apiContext.getOperationsContext().getDatabaseRepository().getDmpDao().find(dataManagementPlan.getId()); + if (dmp.getCreator().getId().equals(principal.getId())) { List userDMPList = dmp.getUsers().stream().collect(Collectors.toList()); for (UserInfoListingModel userInfoListingModel : dataManagementPlan.getUsers()) { for(UserDMP userDMP : userDMPList) {