Fixed other methods do remove ASL session and test.user
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@134771 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
efa2a9aca0
commit
7aadc44989
|
@ -78,7 +78,6 @@ import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.GWTD
|
||||||
import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.GWTImageDocument;
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.GWTImageDocument;
|
||||||
import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.GWTUrlDocument;
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.GWTUrlDocument;
|
||||||
import org.gcube.portlets.user.workspace.server.util.UserUtil;
|
import org.gcube.portlets.user.workspace.server.util.UserUtil;
|
||||||
import org.gcube.portlets.user.workspace.server.util.WsUtil;
|
|
||||||
import org.gcube.portlets.user.workspace.shared.WorkspaceACL;
|
import org.gcube.portlets.user.workspace.shared.WorkspaceACL;
|
||||||
import org.gcube.portlets.user.workspace.shared.WorkspaceACL.USER_TYPE;
|
import org.gcube.portlets.user.workspace.shared.WorkspaceACL.USER_TYPE;
|
||||||
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingEntryType;
|
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingEntryType;
|
||||||
|
@ -131,7 +130,6 @@ public class GWTWorkspaceBuilder {
|
||||||
hashTestUser.put("pasquale.pagano", new InfoContactModel("pasquale.pagano", "pasquale.pagano", "Pasquale Pagano",false));
|
hashTestUser.put("pasquale.pagano", new InfoContactModel("pasquale.pagano", "pasquale.pagano", "Pasquale Pagano",false));
|
||||||
hashTestUser.put("valentina.marioli", new InfoContactModel("valentina.marioli", "valentina.marioli", "Valentina Marioli",false));
|
hashTestUser.put("valentina.marioli", new InfoContactModel("valentina.marioli", "valentina.marioli", "Valentina Marioli",false));
|
||||||
hashTestUser.put("roberto.cirillo", new InfoContactModel("roberto.cirillo", "roberto.cirillo", "Roberto Cirillo",false));
|
hashTestUser.put("roberto.cirillo", new InfoContactModel("roberto.cirillo", "roberto.cirillo", "Roberto Cirillo",false));
|
||||||
hashTestUser.put(WsUtil.TEST_USER.toString(), new InfoContactModel(WsUtil.TEST_USER, WsUtil.TEST_USER, WsUtil.TEST_USER_FULL_NAME,false));
|
|
||||||
hashTestUser.put("francesco.mangiacrapa", new InfoContactModel("francesco.mangiacrapa", "francesco.mangiacrapa", "Francesco Mangiacrapa",false));
|
hashTestUser.put("francesco.mangiacrapa", new InfoContactModel("francesco.mangiacrapa", "francesco.mangiacrapa", "Francesco Mangiacrapa",false));
|
||||||
hashTestUser.put("massimiliano.assante", new InfoContactModel("massimiliano.assante", "massimiliano.assante", "Massimiliano Assante",false));
|
hashTestUser.put("massimiliano.assante", new InfoContactModel("massimiliano.assante", "massimiliano.assante", "Massimiliano Assante",false));
|
||||||
|
|
||||||
|
|
|
@ -2682,7 +2682,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
String lastName = "User";
|
String lastName = "User";
|
||||||
boolean publishRights = false;
|
boolean publishRights = false;
|
||||||
|
|
||||||
if (isWithinPortal() && username.compareTo(WsUtil.TEST_USER) != 0) {
|
if (isWithinPortal() && username != null) {
|
||||||
try {
|
try {
|
||||||
LiferayUserManager l = new LiferayUserManager();
|
LiferayUserManager l = new LiferayUserManager();
|
||||||
GCubeUser user = l.getUserByUsername(username);
|
GCubeUser user = l.getUserByUsername(username);
|
||||||
|
@ -2718,7 +2718,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
PortalContextInfo info = WsUtil.getPortalContext(this.getThreadLocalRequest());
|
PortalContextInfo info = WsUtil.getPortalContext(this.getThreadLocalRequest());
|
||||||
String username = info.getUsername();
|
String username = info.getUsername();
|
||||||
String firstName = "";
|
String firstName = "";
|
||||||
if (isWithinPortal() && username.compareTo(WsUtil.TEST_USER) != 0) {
|
if (isWithinPortal() && username != null) {
|
||||||
try {
|
try {
|
||||||
LiferayUserManager l = new LiferayUserManager();
|
LiferayUserManager l = new LiferayUserManager();
|
||||||
GCubeUser user = l.getUserByUsername(username);
|
GCubeUser user = l.getUserByUsername(username);
|
||||||
|
@ -3483,7 +3483,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(username.equals(WsUtil.TEST_USER)){
|
if(username == null){
|
||||||
workspaceLogger.warn("Session expired");
|
workspaceLogger.warn("Session expired");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,8 @@ import com.liferay.portal.service.UserLocalServiceUtil;
|
||||||
*/
|
*/
|
||||||
public class WsUtil {
|
public class WsUtil {
|
||||||
|
|
||||||
|
protected static Logger logger = Logger.getLogger(WsUtil.class);
|
||||||
|
|
||||||
public static final String FOLDERIMPORTER_ATTRIBUTE = "FOLDER_IMPORTER";
|
public static final String FOLDERIMPORTER_ATTRIBUTE = "FOLDER_IMPORTER";
|
||||||
public static final String METADATACONVERTER_ATTRIBUTE = "METADATA_CONVERTER";
|
public static final String METADATACONVERTER_ATTRIBUTE = "METADATA_CONVERTER";
|
||||||
public static final String WORKSPACE_EVENT_COLLECTOR_ATTRIBUTE = "EVENT_COLLECTOR";
|
public static final String WORKSPACE_EVENT_COLLECTOR_ATTRIBUTE = "EVENT_COLLECTOR";
|
||||||
|
@ -53,25 +55,11 @@ public class WsUtil {
|
||||||
public static final String PROPERTY_SPECIAL_FOLDER = "PROPERTY_SPECIAL_FOLDER";
|
public static final String PROPERTY_SPECIAL_FOLDER = "PROPERTY_SPECIAL_FOLDER";
|
||||||
public static final String NOTIFICATION_PORTLET_CLASS_ID = "org.gcube.portlets.user.workspace.server.GWTWorkspaceServiceImpl"; //IN DEV
|
public static final String NOTIFICATION_PORTLET_CLASS_ID = "org.gcube.portlets.user.workspace.server.GWTWorkspaceServiceImpl"; //IN DEV
|
||||||
|
|
||||||
// public static final String TEST_SCOPE = "/d4science.research-infrastructures.eu";
|
|
||||||
// public static final String TEST_TOKEN = "57b42a99-6239-44c4-9a68-591c18363222-843339462"; //username Francesco Mangiacrapa scope: BiodiversityLab
|
|
||||||
public static final String TEST_SCOPE = "/gcube";
|
|
||||||
public static final String TEST_TOKEN = "89257623-0570-4fbe-a15b-458bb84f4902-98187548"; //username Francesco Mangiacrapa scope: NextNext
|
|
||||||
|
|
||||||
//UNCOMMENT THIS FOR RELEASE
|
|
||||||
public static String TEST_USER = "test.user";
|
|
||||||
public static String TEST_USER_FULL_NAME = "Test User";
|
|
||||||
|
|
||||||
|
|
||||||
protected static Logger logger = Logger.getLogger(WsUtil.class);
|
|
||||||
|
|
||||||
// public static boolean withoutPortal = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if is within portal.
|
* Checks if is within portal.
|
||||||
*
|
*
|
||||||
* @return true if you're running into the portal, false if in development
|
* @return true if you're running into the portal, false if in development
|
||||||
*/
|
*/
|
||||||
public static boolean isWithinPortal() {
|
public static boolean isWithinPortal() {
|
||||||
try {
|
try {
|
||||||
UserLocalServiceUtil.getService();
|
UserLocalServiceUtil.getService();
|
||||||
|
|
Loading…
Reference in New Issue