ozeigermann    2005/02/03 13:03:32

  Modified:    webdavclient/clientlib/src/java/org/apache/webdav/lib/methods
                        AclMethod.java
               webdavclient/clientlib/src/java/org/apache/webdav/lib
                        Ace.java
               src/webdav/server/org/apache/slide/webdav/util/properties
                        AclProperty.java
               src/webdav/server/org/apache/slide/webdav/method
                        AclMethod.java
               webdavclient/clientlib/src/java/org/apache/webdav/lib/properties
                        AclProperty.java
  Log:
  Applied patch #33363 contributed by Nick Longinow.
  
  Slide proprietary WebDAV extension to allow disabling inheritance
  of security settings.
  
  Revision  Changes    Path
  1.9       +8 -3      
jakarta-slide/webdavclient/clientlib/src/java/org/apache/webdav/lib/methods/AclMethod.java
  
  Index: AclMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/webdavclient/clientlib/src/java/org/apache/webdav/lib/methods/AclMethod.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AclMethod.java    2 Aug 2004 15:45:48 -0000       1.8
  +++ AclMethod.java    3 Feb 2005 21:03:32 -0000       1.9
  @@ -136,6 +136,11 @@
               printer.writeElement("D", null, "ace",
                                    XMLPrinter.OPENING);
   
  +            if (ace.isInheritable() != true) {
  +                printer.writeElement("S", 
"http://jakarta.apache.org/slide/";, "non-inheritable",
  +                        XMLPrinter.NO_CONTENT);
  +            }
  +
               printer.writeElement("D", null, "principal",
                                    XMLPrinter.OPENING);
   
  
  
  
  1.6       +29 -4     
jakarta-slide/webdavclient/clientlib/src/java/org/apache/webdav/lib/Ace.java
  
  Index: Ace.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/webdavclient/clientlib/src/java/org/apache/webdav/lib/Ace.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Ace.java  23 Nov 2004 12:57:13 -0000      1.5
  +++ Ace.java  3 Feb 2005 21:03:32 -0000       1.6
  @@ -52,6 +52,11 @@
           this.inheritedFrom = inheritedFrom;
       }
   
  +    public Ace(String principal, boolean negative, boolean protectedAce,
  +            boolean inheritable) {
  +            this(principal, negative, protectedAce, false, null);
  +            this.inheritable = inheritable;
  +    }
   
       // ----------------------------------------------------- Instance 
Variables
   
  @@ -87,6 +92,11 @@
   
   
       /**
  +     * Inheritable.
  +     */
  +    protected boolean inheritable = true;
  +
  +    /**
        * Inherited from.
        */
       protected String inheritedFrom = null;
  @@ -164,6 +174,21 @@
           this.inherited = inherited;
       }
   
  +    /**
  +     * Inheritable mutator.
  +     */
  +    public void setInheritable(boolean inheritable) {
  +            this.inheritable = inheritable;
  +    }
  +
  +    /**
  +     * Inheritable accessor.
  +     */
  +    public boolean isInheritable()
  +    {
  +            return inheritable;
  +    }
  +
   
       /**
        * Inherited from accessor.
  
  
  
  1.4       +10 -4     
jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/properties/AclProperty.java
  
  Index: AclProperty.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/properties/AclProperty.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AclProperty.java  3 Jan 2005 15:04:44 -0000       1.3
  +++ AclProperty.java  3 Feb 2005 21:03:32 -0000       1.4
  @@ -55,7 +55,7 @@
   import org.jdom.Element;
   import org.jdom.Namespace;
   import org.jdom.Text;
  -
  +import org.apache.slide.content.NodeProperty.NamespaceCache;
   
   /**
    * Computes the ACL <code>acl</code> property.
  @@ -130,6 +130,12 @@
                   if (inheritedFrom != null && inheritedFrom.length() > 0) {
                       
currentAceElm.addContent(createInheritedElement(inheritedFrom));
                   }
  +
  +                // inheritable
  +                if (perm.isInheritable() == false) {
  +                    currentAceElm.addContent(new Element("non-inheritable",
  +                            NamespaceCache.SLIDE_NAMESPACE));
  +                }
                   
                   // protected
                   if (perm.isProtected()) {
  
  
  
  1.49      +12 -5     
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AclMethod.java
  
  Index: AclMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AclMethod.java,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- AclMethod.java    21 Dec 2004 16:04:19 -0000      1.48
  +++ AclMethod.java    3 Feb 2005 21:03:32 -0000       1.49
  @@ -50,7 +50,7 @@
   import org.apache.slide.event.EventDispatcher;
   import org.jdom.Element;
   import org.jdom.JDOMException;
  -
  +import org.apache.slide.content.NodeProperty.NamespaceCache;
   
   /**
    * ACL method.
  @@ -133,6 +133,13 @@
           String actionUri = null;
           boolean negative = false;
           boolean invert = false;
  +        boolean inheritance = true;
  +
  +        // inheritance element
  +        Element inheritanceElm = aceElm.getChild("non-inheritable", 
NamespaceCache.SLIDE_NAMESPACE);
  +        if (inheritanceElm != null) {
  +            inheritance = false;
  +        }
           
           // ACE principal
           Element principalElm = aceElm.getChild(E_PRINCIPAL, DNSP);
  @@ -184,7 +191,7 @@
                   );
               }
               else {
  -                NodePermission np = new NodePermission(objectUri, 
subjectUri, actionUri, true, negative);
  +                NodePermission np = new NodePermission(objectUri, 
subjectUri, actionUri, inheritance, negative);
                   np.setInvert(invert);
                   result.add(np);
               }
  
  
  
  1.6       +9 -4      
jakarta-slide/webdavclient/clientlib/src/java/org/apache/webdav/lib/properties/AclProperty.java
  
  Index: AclProperty.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/webdavclient/clientlib/src/java/org/apache/webdav/lib/properties/AclProperty.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AclProperty.java  2 Aug 2004 15:45:50 -0000       1.5
  +++ AclProperty.java  3 Feb 2005 21:03:32 -0000       1.6
  @@ -181,6 +181,11 @@
               ace.setProtected(true);
           }
   
  +        child = DOMUtils.getFirstElement(element, 
"http://jakarta.apache.org/slide/";, "non-inheritable");
  +        if (child != null) {
  +            ace.setInheritable(false);
  +        }
  +
           return ace;
   
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to