Added check to instance portlet outside from portal
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@130099 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ded7fa39a9
commit
bd30f11a71
|
@ -55,6 +55,7 @@ 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 = "/gcube/devsec/devVRE";
|
||||
public final static String TEST_MAIL = "test.user@test-com";
|
||||
public final static String TEST_SEC_TOKEN = "4620e6d0-2313-4f48-9d54-eb3efd01a810";
|
||||
|
||||
|
@ -76,9 +77,16 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
HttpSession httpSession = getThreadLocalRequest().getSession();
|
||||
String currentScope = getASLSession(httpSession).getScope();
|
||||
|
||||
CKanUtils instance = null;
|
||||
String user = (String) httpSession.getAttribute(USERNAME_ATTRIBUTE);
|
||||
|
||||
CKanUtils instance = null;
|
||||
try{
|
||||
if(user.equals(TEST_USER)){
|
||||
//USE
|
||||
logger.warn("User is "+TEST_USER +" are we out from portal?");
|
||||
logger.warn("I'm using root scope "+PRODUCTION_SCOPE);
|
||||
return new CKanUtilsImpl(PRODUCTION_SCOPE);
|
||||
}
|
||||
logger.debug("The ckan util object was null");
|
||||
instance = new CKanUtilsImpl(currentScope);
|
||||
}catch(Exception e){
|
||||
|
|
Loading…
Reference in New Issue