diff --git a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/AssociationToGroupThread.java b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/AssociationToGroupThread.java index 0e21b51..4b15689 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/AssociationToGroupThread.java +++ b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/AssociationToGroupThread.java @@ -51,10 +51,13 @@ public class AssociationToGroupThread extends Thread { }else{ logger.debug("Group exists, going to add the user " + username + " as its admin..."); - + // retrieve the role to be assigned according the one the user has into the organization of the dataset RolesCkanGroupOrOrg role = RolesCkanGroupOrOrg.valueOf(catalogue.getRoleOfUserInOrganization(username, organization, catalogue.getApiKeyFromUsername(username)).toUpperCase()); + if(!role.equals(RolesCkanGroupOrOrg.ADMIN)) + role = RolesCkanGroupOrOrg.MEMBER; // decrease the role to member if it is not an admin + boolean assigned = catalogue.checkRoleIntoGroup(username, groupTitle, role); if(assigned){