Updated the liferay's roles that map the ones of ckan (editor, member, admin)
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/ckan-util-library@129311 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
75c7c16c00
commit
29950eff98
|
@ -1,11 +1,13 @@
|
|||
package org.gcube.datacatalogue.ckanutillibrary.models;
|
||||
|
||||
/**
|
||||
* These roles are present in liferay and are a one to one map with the ones into ckan.
|
||||
* CKan roles as appear in Liferay
|
||||
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
||||
*/
|
||||
public enum CkanRolesIntoLiferay {
|
||||
CATALOG_MEMBER,
|
||||
CATALOG_EDITOR,
|
||||
CATALOG_ADMIN
|
||||
public class CkanRolesIntoLiferay {
|
||||
|
||||
public static final String CATALOG_MEMBER = "Catalogue-Member";
|
||||
public static final String CATALOG_ADMIN = "Catalogue-Admin";
|
||||
public static final String CATALOG_EDITOR = "Catalogue-Editor";
|
||||
|
||||
}
|
||||
|
|
|
@ -8,7 +8,9 @@ import org.gcube.datacatalogue.ckanutillibrary.models.CKanUserWrapper;
|
|||
import org.gcube.datacatalogue.ckanutillibrary.models.RolesIntoOrganization;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import eu.trentorise.opendata.jackan.CkanClient;
|
||||
import eu.trentorise.opendata.jackan.model.CkanOrganization;
|
||||
import eu.trentorise.opendata.jackan.model.CkanUser;
|
||||
|
||||
public class TestCKanLib {
|
||||
|
||||
|
@ -79,5 +81,21 @@ public class TestCKanLib {
|
|||
|
||||
System.out.println("organizations for user " + username + " are " + map);
|
||||
}
|
||||
|
||||
|
||||
//@Test
|
||||
public void getUsers() throws Exception{
|
||||
|
||||
instance = new CKanUtilsImpl("/gcube");
|
||||
|
||||
CkanClient client = new CkanClient(instance.getCatalogueUrl());
|
||||
|
||||
CkanOrganization org = client.getOrganization("devvre");
|
||||
List<CkanUser> users = org.getUsers();
|
||||
|
||||
for (CkanUser ckanUser : users) {
|
||||
logger.debug("User is " + ckanUser.getName());
|
||||
logger.debug("Capacity is " + ckanUser.getCapacity());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue