minor fix

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@129847 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-07-04 12:11:43 +00:00
parent 37087d2d4f
commit 4c1734bd50
2 changed files with 3 additions and 3 deletions

View File

@ -311,7 +311,7 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
// 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)){
UserUtil.getLicenses(httpSession, username, concatenateSessionKeyScope(CKAN_LICENSES_KEY, currentScope), ckanUtils); UserUtil.getLicenses(httpSession, username, concatenateSessionKeyScope(CKAN_LICENSES_KEY, currentScope), ckanUtils);
UserUtil.getUserOrganizationsList(httpSession, username, 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);
} }
} }

View File

@ -309,14 +309,14 @@ public class UserUtil {
* @param ckanOrganizationsPublishKey * @param ckanOrganizationsPublishKey
* @param ckanUtils * @param ckanUtils
*/ */
public static void getUserOrganizationsList(HttpSession session, String username, public static void getUserOrganizationsList(HttpSession session, String username, boolean isSysAdmin,
String ckanOrganizationsPublishKey, CKanUtils ckanUtils, String token) { String ckanOrganizationsPublishKey, CKanUtils ckanUtils, String token) {
try{ try{
logger.debug("Request for user " + username + " organizations list"); logger.debug("Request for user " + username + " organizations list");
List<String> orgsName = new ArrayList<String>(); List<String> orgsName = new ArrayList<String>();
if(ckanUtils.isSysAdmin(username, token)){ if(isSysAdmin){
logger.info("The user " + username + " is a sysadmin. He can publish everywhere"); logger.info("The user " + username + " is a sysadmin. He can publish everywhere");
orgsName = ckanUtils.getOrganizationsNames(); // get all organizations' names orgsName = ckanUtils.getOrganizationsNames(); // get all organizations' names