minor fix
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@130556 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
5577c0715e
commit
82fed8eb45
|
@ -310,12 +310,12 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
||||||
logger.info("Set role " + toReturn + " into session for user " + username);
|
logger.info("Set role " + toReturn + " into session for user " + username);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if he is not a member (so he can publish), preload:
|
// if he is not a member/editor (so he can publish), preload:
|
||||||
// 1) organizations in which he can publish
|
// 1) organizations in which he can publish
|
||||||
// 2) the list of licenses
|
// 2) the list of licenses
|
||||||
// 3) metadata profiles
|
// 3) metadata profiles
|
||||||
// In this way the publish widget can simply retrieve those information from the ASL session
|
// In this way the publish widget can simply retrieve those information from the ASL session
|
||||||
if(!toReturn.equals(CkanRole.MEMBER)){
|
if(!(toReturn.equals(CkanRole.MEMBER) || toReturn.equals(CkanRole.EDITOR))){
|
||||||
UserUtil.getLicenses(httpSession, username, concatenateSessionKeyScope(CKAN_LICENSES_KEY, currentScope), ckanUtils);
|
UserUtil.getLicenses(httpSession, username, concatenateSessionKeyScope(CKAN_LICENSES_KEY, currentScope), ckanUtils);
|
||||||
UserUtil.getUserOrganizationsList(httpSession, username, isSysAdmin, concatenateSessionKeyScope(CKAN_ORGANIZATIONS_PUBLISH_KEY, currentScope), ckanUtils, getUserCKanTokenFromSession());
|
UserUtil.getUserOrganizationsList(httpSession, username, isSysAdmin, concatenateSessionKeyScope(CKAN_ORGANIZATIONS_PUBLISH_KEY, currentScope), ckanUtils, getUserCKanTokenFromSession());
|
||||||
UserUtil.getMetadataProfilesList(httpSession, username, concatenateSessionKeyScope(CKAN_PROFILES_KEY, currentScope), ckanUtils);
|
UserUtil.getMetadataProfilesList(httpSession, username, concatenateSessionKeyScope(CKAN_PROFILES_KEY, currentScope), ckanUtils);
|
||||||
|
|
|
@ -333,9 +333,8 @@ public class UserUtil {
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
// We need to retrieve orgs in which the user has the roles ADMIN or EDITOR
|
// We need to retrieve orgs in which the user has the roles ADMIN
|
||||||
List<RolesIntoOrganization> rolesToMatch = new ArrayList<RolesIntoOrganization>();
|
List<RolesIntoOrganization> rolesToMatch = new ArrayList<RolesIntoOrganization>();
|
||||||
rolesToMatch.add(RolesIntoOrganization.EDITOR);
|
|
||||||
rolesToMatch.add(RolesIntoOrganization.ADMIN);
|
rolesToMatch.add(RolesIntoOrganization.ADMIN);
|
||||||
|
|
||||||
Map<String, List<RolesIntoOrganization>> orgsAndRoles = ckanUtils.getGroupsAndRolesByUser(username, rolesToMatch);
|
Map<String, List<RolesIntoOrganization>> orgsAndRoles = ckanUtils.getGroupsAndRolesByUser(username, rolesToMatch);
|
||||||
|
@ -347,7 +346,7 @@ public class UserUtil {
|
||||||
Map.Entry<String, List<RolesIntoOrganization>> entry = (Map.Entry<String, List<RolesIntoOrganization>>) iterator
|
Map.Entry<String, List<RolesIntoOrganization>> entry = (Map.Entry<String, List<RolesIntoOrganization>>) iterator
|
||||||
.next();
|
.next();
|
||||||
orgsName.add(entry.getKey());
|
orgsName.add(entry.getKey());
|
||||||
logger.debug("The user has a role ADMIN/EDITOR into org " + entry.getKey());
|
logger.debug("The user has a role ADMIN into org " + entry.getKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
session.setAttribute(ckanOrganizationsPublishKey, orgsName);
|
session.setAttribute(ckanOrganizationsPublishKey, orgsName);
|
||||||
|
|
Loading…
Reference in New Issue