Good morning,

 

 Have you checked the following parameter?

 

 <parameter name="acl_inheritance_type">[path|0|1|...]</parameter>

 

 It’s configurable in the Domain.xml

 

 Hope this helps,

 Miguel Figueiredo

 

 

-----Original Message-----
From: Maximo Gurmendez [mailto:[EMAIL PROTECTED] 
Sent: segunda-feira, 25 de Julho de 2005 5:20
To: Slide Users Mailing List
Subject: My "dirty" solution to set non-inheritable privileges using webdav
client

 

I've modified the createNodePermissionList method from
org.apache.slide.webdav.method.AclMethod class as pasted below.

For doing this I send through webdav a new privilege "read-noninheritable"
or "write-noninheritable", and it works fine.

 

Example, for client:

 

        Ace a = new Ace("/users/auser");

        a.setInherited(false);

        a.addPrivilege(new
Privilege("ECADEMICUS:","read-noninherited","inherit"));

        a.setProtected(false);

        a.setNegative(false);

        Ace[] aces = new Ace[1];

        aces[0]=a;

        boolean ok = res.aclMethod("/files/afolder",aces);

 

Maybe it is not the best, but it was suggested as a posibility. Maybe
someone knows of a better way.

 

Many thanks,

     Máximo

 

Ing. Máximo Gurméndez

IT Applications Integrator

The British Schools, Montevideo

Máximo Tajes 6400

Tel. 6003421 int. 136

email: [EMAIL PROTECTED]

 

 

----------------------------------------------------------------------------
----

 

 

 

private List createNodePermissionList( Element aceElm ) throws
PreconditionViolationException, SlideException, JDOMException {

        List result = new ArrayList();

        String objectUri = resourcePath;

        String subjectUri = null;

        String actionUri = null;

        boolean negative = false;

        boolean invert = false;

        

        // ACE principal

        Element principalElm = aceElm.getChild(E_PRINCIPAL, DNSP);

        if (principalElm == null) {

            Element invertElm = aceElm.getChild(E_INVERT, DNSP);

            if (invertElm != null) {

                invert = true;

                principalElm = invertElm.getChild(E_PRINCIPAL, DNSP);

            }

        }

        if (principalElm != null) {

            subjectUri = createSubjectUri(principalElm);

        }

        else {

            throw new PreconditionViolationException(

                new ViolatedPrecondition("missing-ace-principal",
WebdavStatus.SC_BAD_REQUEST), resourcePath

            );

        }

        

        // ACE grant and deny

        Element grantDenyElm = null;

        Element grantElm = aceElm.getChild(E_GRANT, DNSP);

        Element denyElm = aceElm.getChild(E_DENY, DNSP);

        if (grantElm != null && denyElm == null) {

            grantDenyElm = grantElm;

        }

        else if (grantElm == null && denyElm != null) {

            negative = true;

            grantDenyElm = denyElm;

        }

        else if(grantElm != null && denyElm != null) {

            throw new PreconditionViolationException(

                new ViolatedPrecondition("only-grant-or-deny-allowed",
WebdavStatus.SC_BAD_REQUEST), resourcePath

            );

        }

        else if(grantElm == null && denyElm == null) {

            throw new PreconditionViolationException(

                new ViolatedPrecondition("missing-grant-or-deny",
WebdavStatus.SC_BAD_REQUEST), resourcePath

            );

        }

        Iterator privilegeIt = grantDenyElm.getChildren(E_PRIVILEGE,
DNSP).iterator();

        

        while (privilegeIt.hasNext()) {

            Element privilegeElm = (Element)privilegeIt.next();

            actionUri = createActionUri(privilegeElm);

            if (actionUri == null) {

                throw new PreconditionViolationException(

                    new ViolatedPrecondition("not-supported-privilege",
WebdavStatus.SC_BAD_REQUEST), resourcePath

                );

            }

            else {

                //begin add ecademicus

                boolean inherit=true;

                if (actionUri.endsWith("-noninherited")) {

                    inherit=false;

                    actionUri=actionUri.replaceAll("-noninherited","");

                }

                //end add ecademicus

                    

                    

                //NodePermission np = new NodePermission(objectUri,
subjectUri, actionUri, true, negative);

                // mod ecademicus

                NodePermission np = new NodePermission(objectUri,
subjectUri, actionUri, inherit, negative);

                np.setInvert(invert);

                result.add(np);

            }

        }

        

       

        

        return result;

    }

Reply via email to