Index: modules/uoa-claims-api/trunk/src/main/java/eu/dnetlib/openaire/rest/Authorization.java
===================================================================
--- modules/uoa-claims-api/trunk/src/main/java/eu/dnetlib/openaire/rest/Authorization.java	(revision 51937)
+++ modules/uoa-claims-api/trunk/src/main/java/eu/dnetlib/openaire/rest/Authorization.java	(revision 51938)
@@ -15,8 +15,9 @@
     private static Logger logger = Logger.getLogger(Authorization.class);
     List<String> registeredRoles = new ArrayList<String>(Arrays.asList("Super Administrator", "Portal Administrator", "Expert - Community",
             "Expert - Funder", "Curator - Claim", "Curator - Project", "Curator - Community", "Curator - Institution", "Cuthor", "Registered", "User Manager"));
-    List<String> adminRoles = new ArrayList<String>(Arrays.asList("Super Administrator", "Curator - Claim", "Portal Administrator"));
+    List<String> claimCuratorRoles = new ArrayList<String>(Arrays.asList("Super Administrator", "Curator - Claim", "Portal Administrator"));
     List<String> projectCuratorRoles = new ArrayList<String>(Arrays.asList("Curator - Project"));
+    List<String> communityCuratorRoles = new ArrayList<String>(Arrays.asList("Curator - Community"));
     UserHandler userHandler = null;
     String originServer = null;
 
@@ -36,7 +37,7 @@
 //        }
 //    }
 //
-//    public static boolean isAdmin(String token) {
+//    public static boolean isClaimCurator(String token) {
 //        Claims claims = Jwts.parser()
 //                .setSigningKey(DatatypeConverter.parseBase64Binary("my-very-secret"))
 //                .parseClaimsJws(token).getBody();
@@ -74,16 +75,16 @@
 
     }
 
-    public boolean isAdmin(String token) {
+    public boolean isClaimCurator(String token) {
         UserInfo userInfo = userHandler.getUserInfo(token);
-        return isAdmin(userInfo);
+        return isClaimCurator(userInfo);
 
     }
 
-    public boolean isAdmin(UserInfo userInfo) {
+    public boolean isClaimCurator(UserInfo userInfo) {
         if (userInfo != null && userInfo.getEdu_person_entitlements() != null) {
 
-            return hasRole(userInfo.getEdu_person_entitlements(), adminRoles);
+            return hasRole(userInfo.getEdu_person_entitlements(), claimCuratorRoles);
         } else {
             logger.debug(" User has no Valid UserInfo");
             return false;
@@ -91,6 +92,22 @@
 
     }
 
+    public boolean isCommunityCurator(String token) {
+        UserInfo userInfo = userHandler.getUserInfo(token);
+        return isCommunityCurator(userInfo);
+
+    }
+
+    public boolean isCommunityCurator(UserInfo userInfo) {
+        if (userInfo != null && userInfo.getEdu_person_entitlements() != null) {
+
+            return hasRole(userInfo.getEdu_person_entitlements(), communityCuratorRoles);
+        } else {
+            logger.debug(" User has no Valid UserInfo");
+            return false;
+        }
+
+    }
     public boolean isProjectCurator(String token) {
         UserInfo userInfo = userHandler.getUserInfo(token);
         return isProjectCurator(userInfo);
@@ -121,7 +138,8 @@
     }
 
     public boolean hasValidOrigin(String origin) {
-        if (origin != null && originServer.equals(origin)) {
+        logger.debug("Origin is "+origin +" originServer: "+originServer);
+        if (origin != null && origin.indexOf(originServer)!=-1) {
             return true;
         }
         logger.debug("Not valid origin. Origin server is \"" + origin + "\", but expected value is \"" + originServer + "\". If the expec cted value is not right, check properties file. ");
@@ -136,14 +154,22 @@
         this.registeredRoles = registeredRoles;
     }
 
-    public List<String> getAdminRoles() {
-        return adminRoles;
+    public List<String> getClaimCuratorRoles() {
+        return claimCuratorRoles;
     }
 
-    public void setAdminRoles(List<String> adminRoles) {
-        this.adminRoles = adminRoles;
+    public void setClaimCuratorRoles(List<String> claimCuratorRoles) {
+        this.claimCuratorRoles = claimCuratorRoles;
     }
 
+    public List<String> getCommunityCuratorRoles() {
+        return communityCuratorRoles;
+    }
+
+    public void setCommunityCuratorRoles(List<String> communityCuratorRoles) {
+        this.communityCuratorRoles = communityCuratorRoles;
+    }
+
     public List<String> getProjectCuratorRoles() {
         return projectCuratorRoles;
     }
Index: modules/uoa-claims-api/trunk/src/main/java/eu/dnetlib/openaire/rest/HelloWorldService.java
===================================================================
--- modules/uoa-claims-api/trunk/src/main/java/eu/dnetlib/openaire/rest/HelloWorldService.java	(revision 51937)
+++ modules/uoa-claims-api/trunk/src/main/java/eu/dnetlib/openaire/rest/HelloWorldService.java	(revision 51938)
@@ -75,7 +75,7 @@
                     .build();
         }
 
-        if(authorization.isAdmin(token)) {
+        if(authorization.isClaimCurator(token)) {
 
             int total = -1;
 
@@ -117,8 +117,8 @@
                                      @HeaderParam("X-XSRF-TOKEN") String token,
                                      @CookieParam("AccessToken") String  cookie,
                                      @Context HttpServletRequest request) {
-         
 
+
         if(token == null || token.isEmpty() || cookie == null || cookie.isEmpty() || !cookie.equals(token)){
             authorization.logStatus(token,cookie);
             return Response.status(Response.Status.FORBIDDEN).entity(compose403Message("Forbidden: You don't have permission to access. Maybe you are not registered."))
@@ -127,7 +127,7 @@
         }
 
         UserInfo userInfo = authorization.getUserHandler().getUserInfo(token);
-        if(authorization.isProjectCurator(userInfo)) {
+        if(authorization.isProjectCurator(userInfo)|| authorization.isClaimCurator(userInfo)) {
             String userMail = userInfo.getEmail();
 
             int total = -1;
@@ -190,7 +190,7 @@
         }
 //        logger.debug("Calling API for context with token " + token);
 
-        if(authorization.isAdmin(token)) {
+        if(authorization.isCommunityCurator(token) || authorization.isClaimCurator(token)) {
 
             int total = -1;
             if (contextId == null || contextId.isEmpty()) {
@@ -232,8 +232,8 @@
                                     @HeaderParam("X-XSRF-TOKEN") String token,
                                     @CookieParam("AccessToken") String  cookie,
                                     @Context HttpServletRequest request) {
-         
 
+
         if(token == null || token.isEmpty() || cookie == null || cookie.isEmpty() || !cookie.equals(token)){
             authorization.logStatus(token,cookie);
             return Response.status(Response.Status.FORBIDDEN).entity(compose403Message("Forbidden: You don't have permission to access. Maybe you are not registered."))
@@ -241,7 +241,7 @@
                     .build();
         }
 
-        if(authorization.isAdmin(token)) {
+        if(authorization.isClaimCurator(token)) {
 
             int total = -1;
             if (resultId == null || resultId.isEmpty()) {
@@ -281,8 +281,8 @@
                                   @HeaderParam("X-XSRF-TOKEN") String token,
                                   @CookieParam("AccessToken") String  cookie,
                                   @Context HttpServletRequest request) {
-         
 
+
         if(token == null || token.isEmpty() || cookie == null || cookie.isEmpty() || !cookie.equals(token)){
             return Response.status(Response.Status.FORBIDDEN).entity(compose403Message("Forbidden: You don't have permission to access. Maybe you are not registered."))
                     .type(MediaType.APPLICATION_JSON)
@@ -335,8 +335,8 @@
                                   @HeaderParam("X-XSRF-TOKEN") String token,
                                   @CookieParam("AccessToken") String  cookie,
                                   @Context HttpServletRequest request) {
-         
 
+
         if(token == null || token.isEmpty() || cookie == null || cookie.isEmpty() || !cookie.equals(token)){
             return Response.status(Response.Status.FORBIDDEN).entity(compose403Message("Forbidden: You don't have permission to access. Maybe you are not registered."))
                     .type(MediaType.APPLICATION_JSON)
@@ -395,11 +395,11 @@
                                  @CookieParam("AccessToken") String  cookie,
                                   @Context HttpServletRequest request) {
 
-         
+
         logger.debug("Header  \"Origin\" has value  " + origin);
-   
 
 
+
         if(token == null || token.isEmpty() || cookie == null || cookie.isEmpty() || !cookie.equals(token)){
             logger.debug("User is not  authorized - Eroor 403");
 
@@ -408,10 +408,10 @@
                     .build();
         }
 
-        if(authorization.isAdmin(token)) {
+        if(authorization.isClaimCurator(token)) {
             logger.debug("User is authorized ! !");
             List<Claim> claims = null;
-           
+
             int total = -1;
             try {
                 claims = fetchClaimHandler.fetchAllClaims(limit, offset, keyword, orderby, descending, types,false);
@@ -517,8 +517,8 @@
                                      @HeaderParam("Origin") String origin,
                                      @CookieParam("AccessToken") String  cookie){
 
-         
 
+
          if(token == null || token.isEmpty() || cookie == null || cookie.isEmpty() || !cookie.equals(token)|| !authorization.hasValidOrigin(origin)){
              return Response.status(Response.Status.FORBIDDEN).entity(compose403Message("Forbidden: You don't have permission to access. Maybe you are not registered."))
                      .type(MediaType.APPLICATION_JSON)
@@ -540,7 +540,7 @@
             try {
 
                 if (authorization.isRegistered(userInfo)) {
-                    if (authorization.isAdmin(userInfo) || userInfo.getEmail().equals(fetchClaimHandler.fetchClaimById(claimId,false).getUserMail())) {
+                    if (authorization.isClaimCurator(userInfo) || authorization.isCommunityCurator(userInfo) || userInfo.getEmail().equals(fetchClaimHandler.fetchClaimById(claimId,false).getUserMail())) {
                         if (claimHandler.deleteClaim(claimId)) {
                             deletedIds.add(claimId);
                         } else {
@@ -580,8 +580,8 @@
                              @HeaderParam("X-XSRF-TOKEN") String token,
                              @HeaderParam("Origin") String origin,
                              @CookieParam("AccessToken") String  cookie) {
-         
 
+
         if(token == null || token.isEmpty() || cookie == null || cookie.isEmpty() || !cookie.equals(token) || !authorization.hasValidOrigin(origin)){
             return Response.status(Response.Status.FORBIDDEN).entity(compose403Message("Forbidden: You don't have permission to access. Maybe you are not registered."))
                     .type(MediaType.APPLICATION_JSON)
@@ -653,8 +653,8 @@
                                   @HeaderParam("X-XSRF-TOKEN") String token,
                                   @HeaderParam("Origin") String origin,
                                   @CookieParam("AccessToken") String  cookie) {
-         
 
+
         if(token == null || token.isEmpty() || cookie == null || cookie.isEmpty() || !cookie.equals(token)|| !authorization.hasValidOrigin(origin)){
             return Response.status(Response.Status.FORBIDDEN).entity(compose403Message("Forbidden: You don't have permission to access. Maybe you are not registered."))
                     .type(MediaType.APPLICATION_JSON)
@@ -757,8 +757,8 @@
                                      @HeaderParam("X-XSRF-TOKEN") String token,
                                      @HeaderParam("Origin") String origin,
                                      @CookieParam("AccessToken") String  cookie) {
-         
 
+
         if(token == null || token.isEmpty() || cookie == null || cookie.isEmpty() || !cookie.equals(token)|| !authorization.hasValidOrigin(origin)){
             return Response.status(Response.Status.FORBIDDEN).entity(compose403Message("Forbidden: You don't have permission to access. Maybe you are not registered."))
                     .type(MediaType.APPLICATION_JSON)
@@ -828,7 +828,7 @@
 
 
         if(token == null || token.isEmpty() || cookie == null || cookie.isEmpty() || !cookie.equals(token)|| !authorization.hasValidOrigin(origin)){
-             
+
             return Response.status(Response.Status.FORBIDDEN).entity(compose403Message("Forbidden: You don't have permission to access. Maybe you are not registered."))
                     .type(MediaType.APPLICATION_JSON)
                     .build();
@@ -875,8 +875,8 @@
     @Produces(MediaType.APPLICATION_JSON)
     public Response fetchCommunities(@HeaderParam("X-XSRF-TOKEN") String token,
                                      @CookieParam("AccessToken") String  cookie) throws ISLookUpServiceException {
-         
 
+
         if(token == null || token.isEmpty() || cookie == null || cookie.isEmpty() || !cookie.equals(token)){
             return Response.status(Response.Status.FORBIDDEN).entity(compose403Message("Forbidden: You don't have permission to access. Maybe you are not registered."))
                     .type(MediaType.APPLICATION_JSON)
@@ -903,8 +903,8 @@
     public Response fetchCommunityCategories(@PathParam("communityid") String communityid,
                                              @HeaderParam("X-XSRF-TOKEN") String token,
                                              @CookieParam("AccessToken") String  cookie) throws ISLookUpServiceException {
-         
 
+
         if(token == null || token.isEmpty() || cookie == null || cookie.isEmpty() || !cookie.equals(token)){
             return Response.status(Response.Status.FORBIDDEN).entity(compose403Message("Forbidden: You don't have permission to access. Maybe you are not registered."))
                     .type(MediaType.APPLICATION_JSON)
@@ -938,8 +938,8 @@
     public Response fetchCategoryConcepts(@PathParam("categoryid") String categoryid,
                                           @HeaderParam("X-XSRF-TOKEN") String token,
                                           @CookieParam("AccessToken") String  cookie) throws ISLookUpServiceException {
-         
 
+
         if(token == null || token.isEmpty() || cookie == null || cookie.isEmpty() || !cookie.equals(token)){
             return Response.status(Response.Status.FORBIDDEN).entity(compose403Message("Forbidden: You don't have permission to access. Maybe you are not registered."))
                     .type(MediaType.APPLICATION_JSON)
@@ -1131,7 +1131,7 @@
 //         Authorization authorization =  context.getBean(Authorization.class);
 //         UserHandler userHandler = context.getBean(UserHandler.class);
 //         System.out.println(authorization.getAdminRoles());
-//         authorization.isAdmin("eyJraWQiOiJvaWRjIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwOTMxNzMwMTMyODMzNjMyQG9wZW5taW50ZWQuZXUiLCJhenAiOiIyNGU4MzE3Ni0xMzEyLTRiYTMtYmMwYi1mZmVlYmVhMTYwM2UiLCJpc3MiOiJodHRwczpcL1wvYWFpLm9wZW5taW50ZWQuZXVcL29pZGNcLyIsImV4cCI6MTQ5ODQ4NTk3NiwiaWF0IjoxNDk4NDcxNTc2LCJqdGkiOiJkMWRlZjc1Yi00MTEyLTRiZDktYTIyNi0wZ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k/src/main/java/eu/dnetlib/openaire/rest/inputHandler/UserHandler.java
===================================================================
--- modules/uoa-claims-api/trunk/src/main/java/eu/dnetlib/openaire/rest/inputHandler/UserHandler.java	(revision 51937)
+++ modules/uoa-claims-api/trunk/src/main/java/eu/dnetlib/openaire/rest/inputHandler/UserHandler.java	(revision 51938)
@@ -89,6 +89,7 @@
                 String role = userInfo.getEdu_person_entitlements().get(i);
                 logger.debug("AAI role: "+role);
                 role = role.split(":")[role.split(":").length-1];
+                role = role.split("#")[0];
                 role = role.replace("+"," ");
                 logger.debug("Adding parsed role : "+role);
                 userInfo.getEdu_person_entitlements().set(i,role);
Index: modules/uoa-claims-api/trunk/src/main/resources/eu/dnetlib/openaire/rest/springContext-claims-authorization.properties
===================================================================
--- modules/uoa-claims-api/trunk/src/main/resources/eu/dnetlib/openaire/rest/springContext-claims-authorization.properties	(revision 51937)
+++ modules/uoa-claims-api/trunk/src/main/resources/eu/dnetlib/openaire/rest/springContext-claims-authorization.properties	(revision 51938)
@@ -1,6 +1,7 @@
 
-services.claims.authorization.userInfoUrl = http://mpagasas.di.uoa.gr:8080/uoa-user-management-1.0.0-SNAPSHOT/api/users/getUserInfo?accessToken=
-services.claims.authorization.originServer = http://scoobydoo.di.uoa.gr:5000
-services.claims.authorization.registeredRoles = OpenAIRE Super Administrator,OpenAIRE Portal Administrator,OpenAIRE Expert - Community,OpenAIRE Expert - Funder,OpenAIRE Curator - Claim,OpenAIRE Curator - Project,OpenAIRE Curator - Community,OpenAIRE Curator - Institution,OpenAIRE Author,Registered User,User Manager
-services.claims.authorization.adminRoles = OpenAIRE Super Administrator,OpenAIRE Curator - Claim,OpenAIRE Portal Administrator
-services.claims.authorization.projectCuratorRoles = OpenAIRE Curator - Project,OpenAIRE Super Administrator,OpenAIRE Curator - Claim,OpenAIRE Portal Administrator
+services.claims.authorization.userInfoUrl = http://mpagasas.di.uoa.gr:8080/dnet-user-management-1.0.0-SNAPSHOT/api/users/getUserInfo?accessToken=
+services.claims.authorization.originServer = .di.uoa.gr
+services.claims.authorization.registeredRoles = Super Administrator,Portal Administrator,Expert - Community,Expert - Funder,Curator - Claim,Curator - Project,Curator - Community,Curator - Institution,Author,Registered User,User Manager
+services.claims.authorization.claimCuratorRoles = Super Administrator,Curator - Claim,Portal Administrator
+services.claims.authorization.projectCuratorRoles = Curator - Project,Super Administrator,Curator - Claim,Portal Administrator
+services.claims.authorization.communityCuratorRoles = Curator - Community,Expert - Community,Portal Administrator,Registered User
Index: modules/uoa-claims-api/trunk/src/main/resources/eu/dnetlib/openaire/rest/springContext-claims-authorization.xml
===================================================================
--- modules/uoa-claims-api/trunk/src/main/resources/eu/dnetlib/openaire/rest/springContext-claims-authorization.xml	(revision 51937)
+++ modules/uoa-claims-api/trunk/src/main/resources/eu/dnetlib/openaire/rest/springContext-claims-authorization.xml	(revision 51938)
@@ -25,8 +25,9 @@
 
     <bean id="authorization" class="eu.dnetlib.openaire.rest.Authorization" >
         <property name="registeredRoles" value="#{'${services.claims.authorization.registeredRoles}'.split(',')}"/>
-        <property name="adminRoles"   value="#{'${services.claims.authorization.adminRoles}'.split(',')}"/>
+        <property name="claimCuratorRoles"   value="#{'${services.claims.authorization.claimCuratorRoles}'.split(',')}"/>
         <property name="projectCuratorRoles" value="#{'${services.claims.authorization.projectCuratorRoles}'.split(',')}"/>
+        <property name="communityCuratorRoles" value="#{'${services.claims.authorization.communityCuratorRoles}'.split(',')}"/>
         <property name="userHandler" ref="userHandler"/>
         <property name="originServer" value="${services.claims.authorization.originServer}"/>
 
