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:
parent
32915d2e58
commit
5ae34426be
|
@ -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!");
|
||||
|
|
|
@ -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!");
|
||||
|
|
Loading…
Reference in New Issue