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
This commit is contained in:
Costantino Perciante 2016-10-18 09:51:55 +00:00
parent a03399fd53
commit 493b4c27e9
2 changed files with 6 additions and 6 deletions

View File

@ -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<ResourceBean> 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;

View File

@ -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<ResourceBean> resources = HelperMethods.getResourcesFromBean(record, username);
boolean setPublic = true;
boolean setPublic = false;
// check the license id
String license = null;