<?xml version="1.0" encoding="ISO-8859-1"?>

<document>

  <properties>
        <author email="paul.hussein@jrc.it">Paul Hussein</author>
        <title>Creating Users</title>
    </properties>
  
  <body>

  <section name="Creating Users">
<p>There exists a non-standard mechanism to add users to the
system using the WebDAV protocol. This cannot be used on another WebDAV server
only with the Slide implementation. I am going to do this by using the tool DAV
Explorer avaliable at <a href="http://www.ics.uci.edu/~webdav/" target="_blank">http://www.ics.uci.edu/~webdav/</a>.
I believe this depends upon you having the Slide Realm as the default
authentication mechanism for Slide. This is the default if you have installed
the Tomcat bundle.</p>
  <subsection name="Adding a user">
<ol>
<li>Connecting<br/>
<p>Using Dav Explorer connect to the WebDAV server. You need to connect to the
directory '/slide' as this contains the configuration hirerchy. Thus if you are
running the Slide server on the same machine as the client ( Dav Explorer ) you
connect to <a href="http://127.0.0.1:8080/slide" target="_blank">http://127.0.0.1:8080/slide</a>,
and use the default admin username and password as 'root, 'root'.</p>

<p><img
border="0" width="575" height="291" src="images/creating-users/image001.jpg"/><br/>
<br/>
</p>
</li>
<li>Adding the User<br/>

<p>Under
the directory /slide you will find a directory 'users' in which there are
already directories for the preconfigured users </p>

<p><img
border="0" width="575" height="291" src="images/creating-users/image002.jpg"/></p>

<p>Create a collection under /slide/users with the name of the
collection set to the name of the user.'guest' 'john' 'john2' and 'root'. To
create another user, in the file menu of DAV Explorer is 'create collection'</p>

<p><img border="0" width="575" height="293"
src="images/creating-users/image003.jpg"/><img border="0" width="32"
height="32" src="images/creating-users/image004.gif"/></p>

<p>Use this to create a collection under the 'users' directory
with the name of the collection set to the username. In this example I am going
to create a user with the username 'test'.</p>

<p><img border="0" width="575" height="291"
src="images/creating-users/image005.jpg"/></p>

<p>Thus, under the 'users' collection, you should see the new collection 'test'.</p>

<p><img border="0" width="576" height="292"
src="images/creating-users/image006.jpg"/></p>

<p>Creating a collection in this directory creates a user within
slide.</p>

</li>
<li>Setting the password.<br/>

<p>The next step is
to set the password for this user.</p>

<p><img border="0" width="575" height="292"
src="images/creating-users/image007.jpg"/></p>

<p>Using DAV
Explorer select the new collection you have created, in this instance 'test'
and open the 'View/Modify Properties' window. From this window you should be
able to edit the properties associated with the collection.</p>

<p><img border="0" width="576" height="291"
src="images/creating-users/image008.jpg"/></p>

<p>Using the 'Add'
button, add a property as follows :</p>

<p>Tag : password</p>

<p>Namespace : <a href="http://jakarta.apache.org/slide/Value">http://jakarta.apache.org/slide/</a></p>

<p>Value: &lt;password&gt;</p>

<p><img border="0"
width="576" height="292" src="images/creating-users/image009.jpg"/></p>

<p>For this example
I am going to set the password to 'testpassword'. Make sure then to save and
check the property is set correctly. They should now appear in the property
sheet for the collection.</p>

<p><img border="0" width="575" height="289"
src="images/creating-users/image010.jpg"/></p>

<p>The user is now
created, but before we can test the logon, we need to give the user access to
the system by assigning a role.</p>

</li>
<li>Assigning a role.<br/>
<p>You give access to the new user to the directories of slide by adding the user
to the list of users allowed in the role. That is you can take the role xml
from Domain.xml and add your user in the same format, and save it with property
name 'group-member-set' with namespace 'DAV:'</p>

<p>If you look inside the file Domain.xml, which in the
bundled slide is under the slide directory,  you will find an XML string
defining which users are added to role 'user'.</p>

<pre>
<p>                   
&lt;objectnode classname=&quot;org.apache.slide.structure.SubjectNode&quot;
uri=&quot;/roles/user&quot;&gt;<br/>
                       
&lt;revision&gt;<br/>
                           
&lt;property name=&quot;group-member-set&quot;&gt;&lt;![CDATA[&lt;D:href
xmlns:D='DAV:'&gt;/users/john&lt;/D:href&gt;&lt;D:href
xmlns:D='DAV:'&gt;/users/john2&lt;/D:href&gt;&lt;D:href
xmlns:D='DAV:'&gt;/users/root&lt;/D:href&gt;]]&gt;&lt;/property&gt;<br/>
                       
&lt;/revision&gt;<br/>
                   
&lt;/objectnode&gt;</p>
</pre>
<p>We need to take
this xml form of the property 'group-member-set', add our user to it and set it
as a property of the collection 'user'.  In this
example I am going to add the new user 'test' to the role 'user'. To do this we open the
collection /slide/roles and under there we should find the collection 'user'
which corresponds to the role 'user'</p>

<p><img
border="0" width="575" height="291" src="images/creating-users/image011.jpg"/></p>

<p>Again in the
same way as above, open the properties sheet for this collection, and then add
a property as follows :
<br/>
Name : group-member-set</p>

<br/>

<p>&lt;D:href
xmlns:D='DAV:'&gt;/users/test&lt;/D:href&gt;&lt;D:href
xmlns:D='DAV:'&gt;/users/john&lt;/D:href&gt;&lt;D:href
xmlns:D='DAV:'&gt;/users/john2&lt;/D:href&gt;&lt;D:href
xmlns:D='DAV:'&gt;/users/root&lt;/D:href&gt;]]&gt;</p>

<p>The part I have
added is '<strong>&lt;D:href
xmlns:D='DAV:'&gt;/users/test&lt;/D:href&gt;' </strong>which
is highlighted above. It seems a little complicated, and is. </p>

<p><img border="0" width="576" height="290"
src="images/creating-users/image012.jpg"/></p>

<br/>

<p>Check carefully before you save away as
when you open the property sheet again, you will not be able to see this value
again. Note, that this operation is not cumulative, so if you want to add
another user you will need to insert the other users you added and your new
user to the original string from Domain.xml. I just save the last value in
another property in the 'user' collection.</p>

</li>
<li>Testing the logon.<br/>

<p>All
should be now correct to test the logon. So close or open another DAV Explorer,
this time connecting to <a href="http://127.0.0.1:8080/slide/files">http://127.0.0.1:8080/slide/files</a>
 and enter the new user details.</p>

<p style='margin-bottom:12.0pt'><img border="0"
width="576" height="341" src="images/creating-users/image013.jpg"/><br/>
<br/>
</p>
</li>
</ol>
</subsection>
<subsection name="References">
<p><a
href="http://www.mail-archive.com/slide-user@jakarta.apache.org/msg06231.html">http://www.mail-archive.com/slide-user@jakarta.apache.org/msg06231.html</a></p>

<p><a
href="http://www.mail-archive.com/slide-user@jakarta.apache.org/msg05798.html"
target="_blank">http://www.mail-archive.com/slide-user@jakarta.apache.org/msg05798.html</a><br/>
<a href="http://jakarta.apache.org/slide/howto-acl.html" target="_blank">http://jakarta.apache.org/slide/howto-acl.html</a><br/>
<a
href="http://www.mail-archive.com/slide-user@jakarta.apache.org/msg05981.html"
target="_blank">http://www.mail-archive.com/slide-user@jakarta.apache.org/msg05981.html</a>
</p>

</subsection>
  </section>

</body>
</document>
