redirect user to production root catalogue if he is not logged in
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@130109 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
bd30f11a71
commit
2b9db225fd
|
@ -55,7 +55,7 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
||||||
|
|
||||||
public final static String TEST_USER = "test.user";
|
public final static String TEST_USER = "test.user";
|
||||||
public final static String TEST_SCOPE = "/gcube/devsec/devVRE";
|
public final static String TEST_SCOPE = "/gcube/devsec/devVRE";
|
||||||
public final static String PRODUCTION_SCOPE = "/gcube/devsec/devVRE";
|
public final static String PRODUCTION_SCOPE = "/d4science.research-infrastructures.eu";
|
||||||
public final static String TEST_MAIL = "test.user@test-com";
|
public final static String TEST_MAIL = "test.user@test-com";
|
||||||
public final static String TEST_SEC_TOKEN = "4620e6d0-2313-4f48-9d54-eb3efd01a810";
|
public final static String TEST_SEC_TOKEN = "4620e6d0-2313-4f48-9d54-eb3efd01a810";
|
||||||
|
|
||||||
|
@ -75,20 +75,19 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
||||||
|
|
||||||
// check into session
|
// check into session
|
||||||
HttpSession httpSession = getThreadLocalRequest().getSession();
|
HttpSession httpSession = getThreadLocalRequest().getSession();
|
||||||
String currentScope = getASLSession(httpSession).getScope();
|
ASLSession aslSession = getASLSession(httpSession);
|
||||||
|
String currentScope = aslSession.getScope();
|
||||||
|
|
||||||
String user = (String) httpSession.getAttribute(USERNAME_ATTRIBUTE);
|
String user = aslSession.getUsername();
|
||||||
|
|
||||||
CKanUtils instance = null;
|
CKanUtils instance = null;
|
||||||
try{
|
try{
|
||||||
if(user.equals(TEST_USER)){
|
if(user.equals(TEST_USER)){
|
||||||
//USE
|
|
||||||
logger.warn("User is "+TEST_USER +" are we out from portal?");
|
logger.warn("User is "+TEST_USER +" are we out from portal?");
|
||||||
logger.warn("I'm using root scope "+PRODUCTION_SCOPE);
|
logger.warn("I'm using root scope "+PRODUCTION_SCOPE);
|
||||||
return new CKanUtilsImpl(PRODUCTION_SCOPE);
|
instance = new CKanUtilsImpl(PRODUCTION_SCOPE);
|
||||||
}
|
}else
|
||||||
logger.debug("The ckan util object was null");
|
instance = new CKanUtilsImpl(currentScope);
|
||||||
instance = new CKanUtilsImpl(currentScope);
|
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
logger.error("Unable to retrieve ckan utils", e);
|
logger.error("Unable to retrieve ckan utils", e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue