Index: modules/dnet-openaire-users/branches/beta/pom.xml
===================================================================
--- modules/dnet-openaire-users/branches/beta/pom.xml	(revision 62359)
+++ modules/dnet-openaire-users/branches/beta/pom.xml	(revision 62360)
@@ -7,10 +7,9 @@
         <version>1.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-    <groupId>eu.dnetlib</groupId>
     <artifactId>dnet-openaire-users</artifactId>
     <packaging>war</packaging>
-    <version>2.0.0-BETA</version>
+    <version>2.0.1-BETA</version>
     <scm>
         <developerConnection>
             scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaire-users/branches/beta
Index: modules/dnet-openaire-users/branches/beta/src/main/java/eu/dnetlib/openaire/usermanagement/api/RegistryService.java
===================================================================
--- modules/dnet-openaire-users/branches/beta/src/main/java/eu/dnetlib/openaire/usermanagement/api/RegistryService.java	(revision 62359)
+++ modules/dnet-openaire-users/branches/beta/src/main/java/eu/dnetlib/openaire/usermanagement/api/RegistryService.java	(revision 62360)
@@ -6,7 +6,6 @@
 import com.google.gson.JsonParser;
 import eu.dnetlib.openaire.user.pojos.RoleVerification;
 import eu.dnetlib.openaire.user.utils.EmailSender;
-import eu.dnetlib.openaire.usermanagement.dto.Role;
 import eu.dnetlib.openaire.usermanagement.utils.AuthorizationService;
 import eu.dnetlib.openaire.usermanagement.utils.JsonUtils;
 import eu.dnetlib.openaire.usermanagement.utils.RoleManagement;
@@ -16,7 +15,8 @@
 import org.springframework.http.HttpStatus;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.client.HttpClientErrorException;
 
 import javax.mail.MessagingException;
@@ -106,38 +106,36 @@
     @Path("/create/{type}/{id}")
     @POST
     @Produces(MediaType.APPLICATION_JSON)
-    @PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN)")
+    @PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN, @AuthorizationService.curator(#type))")
     public Response createMemberRole(@PathParam("type") String type, @PathParam("id") String id) {
+        JsonElement element = null;
+        Response response = null;
         try {
-            JsonElement response = calls.createMemberRole(type, id);
-            return Response.status(HttpStatus.CREATED.value()).entity(response.toString()).type(MediaType.APPLICATION_JSON).build();
+            if(type.equals("ri") || type.equals("community")) {
+                element = calls.createMemberRole("ri", id);
+            } else {
+                element = calls.createMemberRole(type, id);
+            }
         } catch (HttpClientErrorException e) {
             String message = new JsonParser().parse(e.getResponseBodyAsString()).getAsJsonObject().get("message").getAsString();
-            return Response.status(e.getStatusCode().value()).entity(jsonUtils.createResponse(message).toString()).type(MediaType.APPLICATION_JSON).build();
+            response = Response.status(e.getStatusCode().value()).entity(jsonUtils.createResponse(message).toString()).type(MediaType.APPLICATION_JSON).build();
+        } finally {
+            try {
+                if(type.equals("ri") || type.equals("community")) {
+                    element = calls.createMemberRole("community", id);
+                }
+                if(element != null) {
+                    response = Response.status(HttpStatus.CREATED.value()).entity(element.toString()).type(MediaType.APPLICATION_JSON).build();
+                }
+            } catch (HttpClientErrorException e) {
+                String message = new JsonParser().parse(e.getResponseBodyAsString()).getAsJsonObject().get("message").getAsString();
+                response = Response.status(e.getStatusCode().value()).entity(jsonUtils.createResponse(message).toString()).type(MediaType.APPLICATION_JSON).build();
+            }
         }
+        return response;
     }
 
     /**
-     * @deprecated
-     *
-     * Create a new role with the given name and description.
-     **/
-    @Path("/createRole")
-    @POST
-    @Produces(MediaType.APPLICATION_JSON)
-    @Consumes(MediaType.APPLICATION_JSON)
-    @PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN)")
-    public Response createRole(@RequestBody Role role) {
-        try {
-            JsonElement response = calls.createRole(role.getName(), role.getDescription());
-            return Response.status(HttpStatus.CREATED.value()).entity(response.toString()).type(MediaType.APPLICATION_JSON).build();
-        } catch (HttpClientErrorException e) {
-            String message = new JsonParser().parse(e.getResponseBodyAsString()).getAsJsonObject().get("message").getAsString();
-            return Response.status(e.getStatusCode().value()).entity(jsonUtils.createResponse(message).toString()).type(MediaType.APPLICATION_JSON).build();
-        }
-    }
-
-    /**
      * Invite user with email to manage a type(Community, etc.) with id(ee, egi, etc.)
      * Auto generated link and code will be sent as response.
      */
@@ -470,4 +468,4 @@
             return Response.status(e.getStatusCode().value()).entity(jsonUtils.createResponse(message).toString()).type(MediaType.APPLICATION_JSON).build();
         }
     }
-}
\ No newline at end of file
+}
Index: modules/dnet-openaire-users/branches/beta/src/main/java/eu/dnetlib/openaire/usermanagement/utils/RoleManagement.java
===================================================================
--- modules/dnet-openaire-users/branches/beta/src/main/java/eu/dnetlib/openaire/usermanagement/utils/RoleManagement.java	(revision 62359)
+++ modules/dnet-openaire-users/branches/beta/src/main/java/eu/dnetlib/openaire/usermanagement/utils/RoleManagement.java	(revision 62360)
@@ -37,7 +37,9 @@
     }
 
     public JsonElement assignMemberRole(String type, String id, HttpServletRequest request) throws HttpClientErrorException {
-        return this.httpUtils.post(url + "/member/" + mapType(type, false) + "/" + id, getSessionCookie(request), null, null);
+        Map<String, String> params = new HashMap<>();
+        params.put("force", "true");
+        return this.httpUtils.post(url + "/member/" + mapType(type, false) + "/" + id, getSessionCookie(request), null, params);
     }
 
     public JsonElement assignManagerRole(String type, String id, HttpServletRequest request) throws HttpClientErrorException {
