You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by cm...@apache.org on 2001/09/24 18:12:10 UTC

cvs commit: jakarta-slide/src/taglib/common/org/apache/slide/taglib/bean NodeBean.java

cmlenz      01/09/24 09:12:09

  Modified:    src/taglib/common/org/apache/slide/taglib/bean NodeBean.java
  Log:
  Exclude the 'nobody' role from the listing returned by NodeBean.getRoles()
  
  Revision  Changes    Path
  1.4       +15 -6     jakarta-slide/src/taglib/common/org/apache/slide/taglib/bean/NodeBean.java
  
  Index: NodeBean.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/taglib/common/org/apache/slide/taglib/bean/NodeBean.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- NodeBean.java	2001/09/20 13:31:08	1.3
  +++ NodeBean.java	2001/09/24 16:12:09	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/taglib/common/org/apache/slide/taglib/bean/NodeBean.java,v 1.3 2001/09/20 13:31:08 dirkv Exp $
  - * $Revision: 1.3 $
  - * $Date: 2001/09/20 13:31:08 $
  + * $Header: /home/cvs/jakarta-slide/src/taglib/common/org/apache/slide/taglib/bean/NodeBean.java,v 1.4 2001/09/24 16:12:09 cmlenz Exp $
  + * $Revision: 1.4 $
  + * $Date: 2001/09/24 16:12:09 $
    *
    * ====================================================================
    *
  @@ -67,6 +67,7 @@
   import java.util.Vector;
   
   import org.apache.slide.common.NamespaceAccessToken;
  +import org.apache.slide.common.NamespaceConfig;
   import org.apache.slide.common.SlideException;
   import org.apache.slide.common.SlideToken;
   import org.apache.slide.content.*;
  @@ -82,7 +83,7 @@
    * layer technologies such as JSP or Velocity.</p>
    * 
    * @author <a href="mailto:cmlenz@apache.org">Christopher Lenz</a>
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    */
   public class NodeBean
       extends AbstractBean {
  @@ -435,18 +436,26 @@
       
       
       /**
  -     * Returns the roles of the node.
  +     * Returns the roles of the node. This excludes the generic 
  +     * &quot;nobody&quot; role.
        *
        * @return a Vector of roles as String objects
        */
       public Vector getRoles() {
           
  +        NamespaceConfig nc = nat.getNamespaceConfig();
  +        String nobody = nc.NOBODY;
  +        
           Vector v = new Vector();
           Security security = nat.getSecurityHelper();
           Enumeration enum = security.getRoles(node);
           while (enum.hasMoreElements()) {
               String role = (String)enum.nextElement();
  -            v.addElement(role);
  +            // exclude the nobody role from the list, as we only want "real" 
  +            // roles to show up in the list
  +            if (!role.equals(nobody)) {
  +                v.addElement(role);
  +            }
           }
           
           return v;