Update of /var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/security
In directory james.mmbase.org:/tmp/cvs-serv26873

Modified Files:
        MayTag.java 
Log Message:
associated 'namespace' with actions to make chance on conflicts smaller, and to 
have a natural relation to components


See also: 
http://cvs.mmbase.org/viewcvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/security


Index: MayTag.java
===================================================================
RCS file: 
/var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/security/MayTag.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- MayTag.java 27 Jul 2007 08:14:32 -0000      1.2
+++ MayTag.java 21 Jan 2008 15:25:45 -0000      1.3
@@ -23,13 +23,14 @@
  *
  * @author Michiel Meeuwissen
  * @since MMBase-1.9
- * @version $Id: MayTag.java,v 1.2 2007/07/27 08:14:32 michiel Exp $
+ * @version $Id: MayTag.java,v 1.3 2008/01/21 15:25:45 michiel Exp $
  */
 
 public class MayTag extends CloudReferrerTag implements Condition {
 
     protected Attribute inverse = Attribute.NULL;
     protected Attribute action = Attribute.NULL;
+    protected Attribute namespace = Attribute.NULL;
 
     public void setInverse(String b) throws JspTagException {
         inverse = getAttribute(b);
@@ -37,12 +38,18 @@
     public void setAction(String a) throws JspTagException {
         action = getAttribute(a);
     }
+
+    public void setNamespace(String a) throws JspTagException {
+        namespace = getAttribute(a);
+    }
     protected boolean getInverse() throws JspTagException {
         return inverse.getBoolean(this, false);
     }
 
     public int doStartTag() throws JspTagException {
-        Action a = 
getCloudContext().getActionRepository().get(action.getString(this));
+        String ns = namespace.getString(this);
+        if ("".equals(ns)) ns = null;
+        Action a = getCloudContext().getActionRepository().get(ns, 
action.getString(this));
         if (a == null) throw new JspTagException("No such action '" + 
action.getString(this) + "'");
         if ((getCloudVar().may(a)) != getInverse()) {
             return EVAL_BODY;
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to