minor fixes: the association of a dataset to a group is always performed by the sysadmin

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/ckan-util-library@132002 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-09-28 16:12:40 +00:00
parent cf91c2721a
commit bc442f5caf
2 changed files with 7 additions and 4 deletions

View File

@ -1199,7 +1199,8 @@ public class DataCatalogueImpl implements DataCatalogue{
try{
CheckedCkanClient client = new CheckedCkanClient(CKAN_CATALOGUE_URL, apiKey);
// the association is performed by using the sysadmi api key, since from apis only group admin can perform this operation...
CheckedCkanClient client = new CheckedCkanClient(CKAN_CATALOGUE_URL, CKAN_TOKEN_SYS);
// retrieve the dataset
CkanDataset dataset = client.getDataset(datasetNameOrId);

View File

@ -13,6 +13,7 @@ import org.gcube.datacatalogue.ckanutillibrary.models.CkanDatasetRelationship;
import org.gcube.datacatalogue.ckanutillibrary.models.DatasetRelationships;
import org.gcube.datacatalogue.ckanutillibrary.models.RolesCkanGroupOrOrg;
import org.gcube.datacatalogue.ckanutillibrary.utils.UtilMethods;
import org.junit.Before;
import org.slf4j.LoggerFactory;
import eu.trentorise.opendata.jackan.CheckedCkanClient;
@ -33,7 +34,7 @@ public class TestDataCatalogueLib {
String subjectId = "aa_father4";
String objectId = "bb_son4";
//@Before
@Before
public void before(){
factory = DataCatalogueFactory.getFactory();
}
@ -283,7 +284,7 @@ public class TestDataCatalogueLib {
//@Test
public void createGroup() throws Exception{
//DataCatalogueImpl instance = factory.getUtilsPerScope(scope);
// DataCatalogueImpl instance = factory.getUtilsPerScope(scope);
String title = " SoBigData.eu: Method Metadata NextNext ";
String result = UtilMethods.fromGroupTitleToName(title);
logger.debug(result);
@ -291,7 +292,8 @@ public class TestDataCatalogueLib {
//
// if(group != null){
//
// boolean associated = instance.checkRoleIntoGroup("user_editor_devvre", title, RolesCkanGroupOrOrg.ADMIN);
// boolean associated = instance.checkRoleIntoGroup("user_admin_devvre", "sobigdata_eu_method_metadata_nextnext", RolesCkanGroupOrOrg.ADMIN);
//
// if(associated){
//