added log for user's current role

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/grsf-publisher-ws@134518 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-11-22 11:54:41 +00:00
parent 32915d2e58
commit 5ae34426be
2 changed files with 6 additions and 2 deletions

View File

@ -125,7 +125,9 @@ 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)).equalsIgnoreCase(RolesCkanGroupOrOrg.ADMIN.toString())){
String role = catalogue.getRoleOfUserInOrganization(username, organization, catalogue.getApiKeyFromUsername(username));
logger.info("***************************Role of the user " + username + " is " + role);
if(!role.equalsIgnoreCase(RolesCkanGroupOrOrg.ADMIN.toString())){
status = Status.FORBIDDEN;
throw new Exception("You are not authorized to create a product. Please check you have the Catalogue-admin role!");

View File

@ -122,7 +122,9 @@ 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)).equalsIgnoreCase(RolesCkanGroupOrOrg.ADMIN.toString())){
String role = catalogue.getRoleOfUserInOrganization(username, organization, catalogue.getApiKeyFromUsername(username));
logger.info("***************************Role of the user " + username + " is " + role);
if(!role.equalsIgnoreCase(RolesCkanGroupOrOrg.ADMIN.toString())){
status = Status.FORBIDDEN;
throw new Exception("You are not authorized to create a product. Please check you have the Catalogue-Administrator role!");