You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Krishna Kankipati <kk...@baan.com> on 2004/10/26 17:57:22 UTC

RE: Adding a non-inheritable permission to a folder using webdav clie nt lib not working

Jason,
	Sorry I mis-spelt a sentence. Here is the corrected version

***********************************************************************8
	Do you mean to say that it is not possible to set a permission to a
folder that "would not inherit" to its children. Somehow if I set a
permission in Domain.xml with inheritable=false, it does the job (I know it
uses slide API directly). This contradicts your statement. Also, I am using
webdav client-lib API. Do you think this would be a bug in the webdav
client-lib API?
***********************************************************************8

Krishna


-----Original Message-----
From: Krishna Kankipati 
Sent: Tuesday, October 26, 2004 9:26 AM
To: 'Slide Users Mailing List'
Subject: RE: Adding a non-inheritable permission to a folder using webdav
clie nt lib not working

Jason,
	Do you mean to say that it is not possible to set a permission to a
folder that "would not inherit" to its children. Somehow if I set a
permission in Domain.xml with inheritable=false, it does not job (I know it
uses slide API directly). This contradicts your statement. Also, I am using
webdav client-lib API. Do you think this would be a bug in the webdav
client-lib API? 

Thanks,

Krishna


-----Original Message-----
From: James Mason [mailto:masonjm@apache.org] 
Sent: Tuesday, October 26, 2004 12:34 AM
To: Slide Users Mailing List
Subject: Re: Adding a non-inheritable permission to a folder using webdav
clie nt lib not working

Krishna,

As far as I know Slide always sets permissions on collections to
inheritable.

-James

On Mon, 2004-10-25 at 16:49 -0400, Krishna Kankipati wrote:
> Hi,
> 	I have been trying for quiet some time to add a permission to a
> folder using webdav client-lib that does not inherit to the downstream
> folders. I have taken the code from client-lib that is shipped with slide
> and am using slide 2.1 B1. In my code I use the following fragment to
create
> an ACE object and bind it to ACL. 
> 
> The code works perfectly if 4th parameter (isInherited) is set to false
> 
> // Create new ACE object bIsInherited = false
> aceNew = new Ace(sPrincipal, bDenyPrivilege, false, bIsInherited, null);
> 
> 
> The code does not work if 4th parameter (isInherited) is set to true. I am
> assuming that you set the 4th parameter to true if you are trying to make
> the permission non-inheritable (not allow it to percolate to the
downstream
> folders).
> 
> With 4th parameter set to true, webdav client does not throw any error but
> does not add the permission. Later when I get the ACL for the resource I
> find that the ace has not been added.
> 
> Please let me know if I am missing something ... or if it is possible at
all
> to create a permission(ace) in a ACL which does not percolate to
downstream
> folders using webdav client lib.
> 
> I found that adding a inheritable(false) permission in domain.xml does the
> job as desired. I am wondering why it is not working from webdav client
lib.
> 
> Any help is appreciated !!!!!!
> 
> /******************* code fragment *****************************/
> 
> // Fetch ACL from slide for a folder
> AclProperty acl = webDavResource.aclfindMethod(sResourcePath);
> 
> // Fetch the ACE's (access control entities) of the existing ACL
> Ace[] aces = acl.getAces();
> 
> // Create new ACE object none exists
> if (aces == null)
>    aces = new Ace[0];
> 
> Ace[] oldAces = aces;
> // Create a new ace array (larger then the earlier ace array by 1)
> aces = new Ace[oldAces.length + 1];
> 
> // Copy the old array into the new array
> System.arraycopy(oldAces,0,aces,0,oldAces.length);
> 
> // Create new ACE object bIsInherited = true
> aceNew = new Ace(sPrincipal, bDenyPrivilege, false, bIsInherited, null);
> 
> // Copy the new ace into the new ace array
> aces[oldAces.length] = aceMatchingPrincipal;
> 
> // Create a new privilege
> Privilege privilegeNew = new Privilege(qnPermission.getNamespaceURI(),
> qnPermission.getLocalName(), null);
> 
> // Update the ace object with the new privilege settings
> 
> aceNew.addPrivilege(privilegeNew);
> 	
> // Update repository with new acl for the resource
> bSuccess = webDavResource.aclMethod(sResourcePath, aces);
> 
> 
> 
> Krishna
> (303) 274 3027


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org