Fixed redirection after product creation
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@129633 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
27ab6ac956
commit
f5fe2d0b1f
|
@ -7,6 +7,9 @@
|
||||||
<dependent-module archiveName="ckan-metadata-publisher-widget-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ckan-metadata-publisher-widget/ckan-metadata-publisher-widget">
|
<dependent-module archiveName="ckan-metadata-publisher-widget-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ckan-metadata-publisher-widget/ckan-metadata-publisher-widget">
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
|
<dependent-module archiveName="ckan-util-library-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ckan-util-library/ckan-util-library">
|
||||||
|
<dependency-type>uses</dependency-type>
|
||||||
|
</dependent-module>
|
||||||
<property name="context-root" value="gcube-ckan-datacatalog"/>
|
<property name="context-root" value="gcube-ckan-datacatalog"/>
|
||||||
<property name="java-output-path" value="/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-1.0.0-SNAPSHOT/WEB-INF/classes"/>
|
<property name="java-output-path" value="/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-1.0.0-SNAPSHOT/WEB-INF/classes"/>
|
||||||
</wb-module>
|
</wb-module>
|
||||||
|
|
|
@ -20,7 +20,6 @@ import org.gcube.application.framework.core.session.ASLSession;
|
||||||
import org.gcube.application.framework.core.session.SessionManager;
|
import org.gcube.application.framework.core.session.SessionManager;
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
import org.gcube.common.scope.api.ScopeProvider;
|
||||||
import org.gcube.datacatalogue.ckanutillibrary.CKanUtilsImpl;
|
import org.gcube.datacatalogue.ckanutillibrary.CKanUtilsImpl;
|
||||||
import org.gcube.datacatalogue.ckanutillibrary.models.CkanRolesIntoLiferay;
|
|
||||||
import org.gcube.datacatalogue.ckanutillibrary.models.RolesIntoOrganization;
|
import org.gcube.datacatalogue.ckanutillibrary.models.RolesIntoOrganization;
|
||||||
import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
|
import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
|
||||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GcubeCkanDataCatalogService;
|
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GcubeCkanDataCatalogService;
|
||||||
|
@ -33,6 +32,7 @@ import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager;
|
||||||
import org.gcube.vomanagement.usermanagement.impl.LiferayRoleManager;
|
import org.gcube.vomanagement.usermanagement.impl.LiferayRoleManager;
|
||||||
import org.gcube.vomanagement.usermanagement.impl.LiferayUserManager;
|
import org.gcube.vomanagement.usermanagement.impl.LiferayUserManager;
|
||||||
import org.gcube.vomanagement.usermanagement.model.GCubeRole;
|
import org.gcube.vomanagement.usermanagement.model.GCubeRole;
|
||||||
|
import org.gcube.vomanagement.usermanagement.model.GatewayRolesNames;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@ -284,19 +284,19 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
||||||
logger.debug("The list of roles for " + username + " into " + groupName + " is " + roles);
|
logger.debug("The list of roles for " + username + " into " + groupName + " is " + roles);
|
||||||
|
|
||||||
// the default one
|
// the default one
|
||||||
String mainRole = CkanRolesIntoLiferay.CATALOG_MEMBER;
|
String mainRole = "Catalogue-Member";
|
||||||
RolesIntoOrganization correspondentRoleToCheck = RolesIntoOrganization.MEMBER;
|
RolesIntoOrganization correspondentRoleToCheck = RolesIntoOrganization.MEMBER;
|
||||||
|
|
||||||
// NOTE: it is supposed that there is just one role for this person correspondent to the one in the catalog
|
// NOTE: it is supposed that there is just one role for this person correspondent to the one in the catalog
|
||||||
for (GCubeRole role : roles) {
|
for (GCubeRole role : roles) {
|
||||||
|
|
||||||
logger.debug("User " + username + " has role " + role.getRoleName() + " in " + currentScope);
|
logger.debug("User " + username + " has role " + role.getRoleName() + " in " + currentScope);
|
||||||
if(role.getRoleName().equalsIgnoreCase(CkanRolesIntoLiferay.CATALOG_ADMIN.toString())){
|
if(role.getRoleName().equalsIgnoreCase(GatewayRolesNames.CATALOGUE_ADMIN.getRoleName())){
|
||||||
mainRole = CkanRolesIntoLiferay.CATALOG_ADMIN;
|
mainRole = GatewayRolesNames.CATALOGUE_ADMIN.getRoleName();
|
||||||
correspondentRoleToCheck = RolesIntoOrganization.ADMIN;
|
correspondentRoleToCheck = RolesIntoOrganization.ADMIN;
|
||||||
break;
|
break;
|
||||||
}else if(role.getRoleName().equalsIgnoreCase(CkanRolesIntoLiferay.CATALOG_EDITOR.toString())){
|
}else if(role.getRoleName().equalsIgnoreCase(GatewayRolesNames.CATALOGUE_EDITOR.getRoleName())){
|
||||||
mainRole = CkanRolesIntoLiferay.CATALOG_EDITOR;
|
mainRole = GatewayRolesNames.CATALOGUE_EDITOR.getRoleName();
|
||||||
correspondentRoleToCheck = RolesIntoOrganization.EDITOR;
|
correspondentRoleToCheck = RolesIntoOrganization.EDITOR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -326,9 +326,9 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
||||||
*/
|
*/
|
||||||
private CkanRole reMapRole(String mainRole) {
|
private CkanRole reMapRole(String mainRole) {
|
||||||
switch(mainRole){
|
switch(mainRole){
|
||||||
case CkanRolesIntoLiferay.CATALOG_ADMIN: return CkanRole.ADMIN;
|
case "Catalogue-Admin": return CkanRole.ADMIN;
|
||||||
case CkanRolesIntoLiferay.CATALOG_EDITOR: return CkanRole.EDITOR;
|
case "Catalogue-Editor": return CkanRole.EDITOR;
|
||||||
case CkanRolesIntoLiferay.CATALOG_MEMBER: return CkanRole.MEMBER;
|
case "Catalogue-Member": return CkanRole.MEMBER;
|
||||||
default : return CkanRole.MEMBER;
|
default : return CkanRole.MEMBER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue