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 Raman Sandhu <ra...@adeptia.com> on 2005/07/12 13:25:55 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@adeptia.com] 
Sent: Monday, June 20, 2005 1:09 PM
To: 'Slide Users Mailing List'
Subject: Create User & ACL

 

Hi All

 

 

 

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.

 

 

 

Also which method to use for version controlling.

 

 

 

Thanks

 

 

 

-Raman