Proposed new features

sito <[email protected]>
Newsgroups gmane.comp.cms.infoglue.devel
Message-ID <[email protected]>
Hi again,

We have done some small modifications to the InfoGlue's codebase 
(2.9.7final) that we
are using that we think might be interesting for other users, so before
submitting them to the patch tracker...

FIRST NEW FEATURE
**************************************************************************************
**************************************************************************************
Retrieving only the list of roles a user has access to. This prevents 
non-administrator
users to be able to see/select roles that they don't have permission to 
grant/revoke.
**************************************************************************************
File: 
org.infoglue.cms.applications.contenttool.actions.ViewAccessRightsAction.java
**************************************************************************************

1) drop line 109 --> this.roleList = 
RoleControllerProxy.getController().getAllRoles();

2) insert at line 109 this code:
        //UIB: Filter Roles by InterceptionPoint Role.Read when not in 
Management Tool
        boolean hasRoleAdministrators = false;
        List userRoles = this.getInfoGluePrincipal().getRoles();
        for (int i=0;i< userRoles.size();i++){
            InfoGlueRole rol = (InfoGlueRole)userRoles.get(i);           
            if (rol.getName().equals("administrators")){
                hasRoleAdministrators = true;
                break;
            }
        }       
        hasRoleAdministrators = 
hasRoleAdministrators||this.getInfoGluePrincipal().getIsAdministrator();    
       
        if ( interceptionPointCategory.equals("Role") || 
hasRoleAdministrators){
            this.roleList = 
RoleControllerProxy.getController().getAllRoles();
        }else{           
            if (this.interceptionPointVOList.size() > 0){               
                this.roleList = 
RoleControllerProxy.getController().getAvailableRoles(this.getInfoGluePrincipal(), 
"Role.Read");
                if ((this.roleList == null) || ((this.roleList != 
null)&&(this.roleList.size()==0))){
                    this.roleList = this.getInfoGluePrincipal().getRoles();
                }
            }else{
                this.roleList = 
RoleControllerProxy.getController().getAllRoles();
            }           
        }


3º) insert import at line 47:
    import org.infoglue.cms.security.InfoGlueRole;
*****************************************************************************************************

more features in next emails..

-- 
--------------======ooOO000OOoo======---------------
Vicente Javier Rosselló Ferrer
E-mail: vrossello [arroba] uib.es
Tel: 971 17 2884
Centre de Tecnologies de la Informació a la UIB
CTI - http://www.cti.uib.es
Edifici Anselm Turmeda
Ctra. Valldemossa 7.5km
Universitat de les Illes Balears - http://www.uib.es
==================================================== 



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.