minor fix for the production root
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@130665 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
7a7a33d311
commit
36898524ec
|
@ -56,7 +56,10 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
|
||||
public final static String TEST_USER = "test.user";
|
||||
public final static String TEST_SCOPE = "/gcube/devsec/devVRE";
|
||||
public final static String PRODUCTION_SCOPE = "/d4science.research-infrastructures.eu";
|
||||
// TO BE REMOVED TODO
|
||||
public final static String PRODUCTION_SCOPE_ROOT = "/d4science.research-infrastructures.eu";
|
||||
public final static String PRODUCTION_CKAN_ORGNAME_ROOT = "d4science";
|
||||
public final static String PRODUCTION_LIFERAY_ORGNAME_ROOT = "d4science";
|
||||
public final static String TEST_MAIL = "test.user@test-com";
|
||||
public final static String TEST_SEC_TOKEN = "4620e6d0-2313-4f48-9d54-eb3efd01a810";
|
||||
|
||||
|
@ -83,8 +86,8 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
if(user.equals(TEST_USER)){
|
||||
// session expired or, maybe, outside the portal
|
||||
logger.warn("User is "+TEST_USER +" are we out from portal?");
|
||||
logger.warn("I'm using root scope "+PRODUCTION_SCOPE);
|
||||
instance = new CKanUtilsImpl(PRODUCTION_SCOPE);
|
||||
logger.warn("I'm using root scope "+PRODUCTION_SCOPE_ROOT);
|
||||
instance = new CKanUtilsImpl(PRODUCTION_SCOPE_ROOT);
|
||||
}else{
|
||||
if(discoverScope != null && !discoverScope.isEmpty())
|
||||
instance = new CKanUtilsImpl(discoverScope);
|
||||
|
|
|
@ -206,11 +206,11 @@ public class UserUtil {
|
|||
if(ckanUtils != null){
|
||||
boolean res = ckanUtils.checkRole(username, gCubeGroupName, correspondentRoleToCheck);
|
||||
if(res){
|
||||
|
||||
// get the orgs of the user
|
||||
List<CkanOrganization> ckanOrgs = ckanUtils.getOrganizationsByUser(username);
|
||||
for (CkanOrganization ckanOrganization : ckanOrgs) {
|
||||
if(ckanOrganization.getName().equals(gCubeGroupName.toLowerCase())){
|
||||
if(gCubeGroupName.equals(GcubeCkanDataCatalogServiceImpl.PRODUCTION_LIFERAY_ORGNAME_ROOT) ||
|
||||
ckanOrganization.getName().equals(gCubeGroupName.toLowerCase())){
|
||||
orgsInWhichAdminRole.add(new OrganizationBean(ckanOrganization.getTitle(), ckanOrganization.getName()));
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue