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 Virgilio duce <or...@virgilio.it> on 2005/11/28 11:33:29 UTC

Re: Create User & ACL

Hi All 

  

Able to create user implement ACL and run most of the methods in client 
code. 

Simple 3 steps to create USER is 

  

           /* Follow 3 steps to create a new user. 

             * 1. create a user collection. 

             * 2. set the password property of, this newly created user. 

             * 3. set the "group-member-set" attribute to set the roles of 
new user.   

             */ 

  

            HttpURL url = new 
HttpURL(IndigoConfig.getHIRepositoryHttpPath()); 

            System.out.println("login ID :"+loginUserName +": loginPassword 
:"+loginPassword); 

            url.setUserinfo(loginUserName,loginPassword); 

            

WebdavResource _webdavResource = 
WebdavConnectionFactory.getWebDAVConnection(url); 

            

            String[] dirSplit = 
userName.split("\\"+WebdavConstants.USER_NAME_SEPRATOR); 

            _webdavUtils = new WebdavUtils(_webdavResource); 

            // creates user 

            _webdavUtils.mkcol(webdavUserString); 

            

            _webdavUtils.proppatch(webdavUserString, 
WebdavConstants.PASSWORD_STRING, password, 
WebdavConstants.WEBDAV_NAMESPACE); 

            // Creating Xml of all existing user also 

            _webdavUtils.proppatch(WebdavConstants.WEBDAV_ROLE_STRING, 
WebdavConstants.GROUP_ATTRIBUTE_STRING, _webdavUtils.createXml(usersList), 
null); 

            // close connection 

            WebdavConnectionFactory.closeConnection(_webdavResource); 

  

Thanks 

Raman 

-----Original Message----- 
From: Raman Sandhu [mailto:raman.sandhu@...] 
Sent: Monday, June 20, 2005 1:09 PM 
To: 'Slide Users Mailing List' 
Subject: Create User & ACL 

  

Hi All 

  

  Hi!
Where have yuo found this code? It's a your implementation? What library do you have used? I'm trying to implement a similar functionality but I can't use this code because with my library I can't found constants of class WebDavConstants and method createXml() of class WebDavUtils.

Thanks in advance

Bye


  

Trying to integrate slide. Which API I can use to create user and assign ACL 

to user. Looked into slide client code but that's more of integrated with 

commend line client but I want to do that thru my own programe. Do anyone 

have some sample code which can help me.