From c8adee576e2d5266d2a8466ca3a3b8a13afbeb32 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 16 Oct 2023 12:42:49 +0300 Subject: [PATCH 1/3] Add support for country reasearcher and datasource --- .../entities/Stakeholder.java | 8 ++- .../handlers/utils/RolesUtils.java | 72 ------------------- 2 files changed, 5 insertions(+), 75 deletions(-) delete mode 100644 src/main/java/eu/dnetlib/uoamonitorservice/handlers/utils/RolesUtils.java diff --git a/src/main/java/eu/dnetlib/uoamonitorservice/entities/Stakeholder.java b/src/main/java/eu/dnetlib/uoamonitorservice/entities/Stakeholder.java index 6ab8c78..81bd3d1 100644 --- a/src/main/java/eu/dnetlib/uoamonitorservice/entities/Stakeholder.java +++ b/src/main/java/eu/dnetlib/uoamonitorservice/entities/Stakeholder.java @@ -9,9 +9,11 @@ import java.util.List; enum StakeholderType { - // Do not rename or remove existring values. This may cause problems with already stored values in DB + // Do not rename or remove existing values. This may cause problems with already stored values in DB funder, ri, project, organization, - FUNDER, RI, PROJECT, ORGANIZATION; + country, researcher, datasource, + FUNDER, RI, PROJECT, ORGANIZATION, + COUNTRY, RESEARCHER, DATASOURCE; } enum Locale { @@ -19,7 +21,7 @@ enum Locale { public final String label; - private Locale(String label) { + Locale(String label) { this.label = label; } } diff --git a/src/main/java/eu/dnetlib/uoamonitorservice/handlers/utils/RolesUtils.java b/src/main/java/eu/dnetlib/uoamonitorservice/handlers/utils/RolesUtils.java deleted file mode 100644 index d360654..0000000 --- a/src/main/java/eu/dnetlib/uoamonitorservice/handlers/utils/RolesUtils.java +++ /dev/null @@ -1,72 +0,0 @@ -//package eu.dnetlib.uoamonitorservice.handlers.utils; -// -//import eu.dnetlib.uoaauthorizationlibrary.security.AuthorizationService; -//import org.apache.log4j.Logger; -// -//import java.util.List; -// -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.stereotype.Component; -// -//@Component -//public class RolesUtils { -// @Autowired -// private AuthorizationService authorizationService; -// -// private final Logger log = Logger.getLogger(this.getClass()); -// -// public List getRoles() { -// return authorizationService.getRoles(); -// } -// -// public boolean isPortalAdmin(List roles) { -// if(roles == null) { -// return false; -// } -//// log.debug(authorizationService.PORTAL_ADMIN); -//// log.debug("PortalAdmin: "+roles.contains(authorizationService.PORTAL_ADMIN)); -// return roles.contains(authorizationService.PORTAL_ADMIN); -// } -// -// public boolean isCurator(List roles, String type) { -// if(roles == null) { -// return false; -// } -//// log.debug(authorizationService.curator(type)); -//// log.debug("Curator in "+type+": "+roles.contains(authorizationService.curator(type))); -// return roles.contains(authorizationService.curator(type)); -// } -// -// public boolean isManager(List roles, String type, String id) { -// if(roles == null) { -// return false; -// } -//// log.debug(authorizationService.manager(type, id)); -//// log.debug("Manager in "+type+" - "+id+": "+roles.contains(authorizationService.manager(type, id))); -// return roles.contains(authorizationService.manager(type, id)); -// } -// -// public boolean isMember(List roles, String type, String id) { -// if(roles == null) { -// return false; -// } -//// log.debug(authorizationService.member(type, id)); -//// log.debug("Member in "+type+" - "+id+": "+roles.contains(authorizationService.member(type, id))); -// return roles.contains(authorizationService.member(type, id)); -// } -// -// public boolean isLoggedIn(List roles) { -// if(roles == null || roles.contains(authorizationService.ANONYMOUS_USER)) { -// return false; -// } -// return true; -// } -// -// public boolean hasUpdateAuthority(List roles, String type, String id) { -// return isPortalAdmin(roles) || isCurator(roles, type) || isManager(roles, type, id); -// } -// -// public boolean hasCreateAndDeleteAuthority(List roles, String type) { -// return isPortalAdmin(roles) || isCurator(roles, type); -// } -//} From 615da7f3c287c08c66aba4ba5830415501888755 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Thu, 9 Nov 2023 15:02:11 +0200 Subject: [PATCH 2/3] Add funderType field in stakeholder. --- .../uoamonitorservice/entities/Stakeholder.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/eu/dnetlib/uoamonitorservice/entities/Stakeholder.java b/src/main/java/eu/dnetlib/uoamonitorservice/entities/Stakeholder.java index 81bd3d1..089e459 100644 --- a/src/main/java/eu/dnetlib/uoamonitorservice/entities/Stakeholder.java +++ b/src/main/java/eu/dnetlib/uoamonitorservice/entities/Stakeholder.java @@ -46,6 +46,7 @@ public class Stakeholder { private String defaultId = null; private Locale locale = Locale.EU; private Visibility visibility = Visibility.PRIVATE; + private String funderType; private Date creationDate; private Date updateDate; @@ -70,6 +71,7 @@ public class Stakeholder { defaultId = stakeholder.getDefaultId(); setLocale(stakeholder.getLocale()); setVisibility(stakeholder.getVisibility()); + this.funderType = stakeholder.getFunderType(); creationDate = stakeholder.getCreationDate(); updateDate = stakeholder.getUpdateDate(); } @@ -214,6 +216,14 @@ public class Stakeholder { this.visibility = visibility; } + public String getFunderType() { + return funderType; + } + + public void setFunderType(String funderType) { + this.funderType = funderType; + } + public Date getCreationDate() { return creationDate; } From 9d585f12e0769d71c8cee2dfb2de7c55fc8e03b9 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 14 Nov 2023 13:21:15 +0200 Subject: [PATCH 3/3] Update admin-tools-library --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d112dc3..1cdbd42 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ eu.dnetlib uoa-admin-tools-library - 1.0.8 + 1.0.9 eu.dnetlib