diff --git a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/CKANPublisherServicesImpl.java b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/CKANPublisherServicesImpl.java index b3ef292..80554de 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/CKANPublisherServicesImpl.java +++ b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/CKANPublisherServicesImpl.java @@ -315,6 +315,15 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C if(isWithinPortal()){ try{ + ASLSession aslSession = getASLSession(); + String user = aslSession.getUsername(); + + // check if session expired + if(user.equals(getDevelopmentUser())){ + logger.debug("SESSION EXPIRED"); + return null; + } + logger.debug("Request dataset metadata bean for folder with id " + folderId + " whose owner is " + owner); // get usermanager (liferay) @@ -455,7 +464,17 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C logger.debug("Request for creating a dataset with these information " + toCreate); + ASLSession aslSession = getASLSession(); + String user = aslSession.getUsername(); + try{ + + // check if session expired + if(user.equals(getDevelopmentUser())){ + logger.debug("SESSION EXPIRED"); + return null; + } + // get the owner String username = toCreate.getOwnerIdentifier();