minor fixes taking into account ticket #10596

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/catalogue-ws@162566 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2018-01-25 10:03:11 +00:00
parent 49356f03f6
commit 591529c07f
2 changed files with 3 additions and 2 deletions

View File

@ -49,7 +49,8 @@ public class Item {
// see http://docs.ckan.org/en/latest/api/#ckan.logic.action.get.package_show
Caller caller = AuthorizationProvider.instance.get();
String context = ScopeProvider.instance.get();
return Delegator.delegateGet(caller, context, Constants.ITEM_SHOW, uriInfo, true);
boolean isApplication = CatalogueUtils.isApplicationToken(caller);
return Delegator.delegateGet(caller, context, Constants.ITEM_SHOW, uriInfo, isApplication);
}

View File

@ -83,7 +83,7 @@ public class Resource {
CkanDataset item = utils.getDataset(datasetId, CatalogueUtils.fetchSysAPI(context));
if(organization.equalsIgnoreCase(item.getOrganization().getName()) && username.equals(item.getAuthor())){
return Delegator.delegatePost(caller, context, Constants.ITEM_DELETE, json, uriInfo, true);
return Delegator.delegatePost(caller, context, Constants.RESOURCE_CREATE, json, uriInfo, true);
}else
throw new Exception("You cannot add a resource to this item");