From 493b4c27e91a7b50e67bc7c8d976769cd520fa37 Mon Sep 17 00:00:00 2001 From: Costantino Perciante Date: Tue, 18 Oct 2016 09:51:55 +0000 Subject: [PATCH] stock and fishery in the curation area are published private. for publication purpose the role needed is the Catalogue-Admin one git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/grsf-publisher-ws@133321 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../services/GrsfPublisherFisheryService.java | 6 +++--- .../grsf_publish_ws/services/GrsfPublisherStockService.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/services/GrsfPublisherFisheryService.java b/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/services/GrsfPublisherFisheryService.java index 88a0344..51b5414 100644 --- a/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/services/GrsfPublisherFisheryService.java +++ b/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/services/GrsfPublisherFisheryService.java @@ -137,11 +137,11 @@ public class GrsfPublisherFisheryService { // check the user has editor/admin role into the org String organization = HelperMethods.retrieveOrgNameFromScope(contextInWhichPublish); - if(catalogue.getRoleOfUserInOrganization(username, organization, catalogue.getApiKeyFromUsername(username)).equals(RolesCkanGroupOrOrg.MEMBER)){ + if(!catalogue.getRoleOfUserInOrganization(username, organization, catalogue.getApiKeyFromUsername(username)).equals(RolesCkanGroupOrOrg.ADMIN)){ status = Status.FORBIDDEN; responseBean.setId(null); - throw new Exception("You are not authorized to create a product. Please check you have at least the editor role!"); + throw new Exception("You are not authorized to create a product. Please check you have the Catalogue-admin role!"); } @@ -215,7 +215,7 @@ public class GrsfPublisherFisheryService { List resources = HelperMethods.getResourcesFromBean(record, username); // if confirmed, set to visible TODO anyway if it is confirmed we should another method - boolean setPublic = true; + boolean setPublic = false; // check the license id String license = null; diff --git a/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/services/GrsfPublisherStockService.java b/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/services/GrsfPublisherStockService.java index 031650c..5061a89 100644 --- a/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/services/GrsfPublisherStockService.java +++ b/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/services/GrsfPublisherStockService.java @@ -137,11 +137,11 @@ public class GrsfPublisherStockService { // check the user has editor/admin role into the org String organization = HelperMethods.retrieveOrgNameFromScope(contextInWhichPublish); - if(catalogue.getRoleOfUserInOrganization(username, organization, catalogue.getApiKeyFromUsername(username)).equals(RolesCkanGroupOrOrg.MEMBER)){ + if(!catalogue.getRoleOfUserInOrganization(username, organization, catalogue.getApiKeyFromUsername(username)).equals(RolesCkanGroupOrOrg.ADMIN)){ status = Status.FORBIDDEN; responseBean.setId(null); - throw new Exception("You are not authorized to create a product. Please check you have at least the editor role!"); + throw new Exception("You are not authorized to create a product. Please check you have the Catalogue-Administrator role!"); } @@ -206,7 +206,7 @@ public class GrsfPublisherStockService { // evaluate the resources List resources = HelperMethods.getResourcesFromBean(record, username); - boolean setPublic = true; + boolean setPublic = false; // check the license id String license = null;