Bita Shadgar wrote:

> Dirk Verbeeck wrote:
>
>> Bita Shadgar wrote:
>>
>> > I had installed slide 1.0.11 before and I could create mkcol,
>> proppatch
>> > and propget by using the run.sh in client/bin directory and also
>> make
>> > them persistent into a database. Do you know how can I use the
>> slide's
>> > webdav client with jakarta-tomcat-3.2.3.
>>
>> just copy slide.war in the webapps directory (and restart) and do
>> "open http://localhost:8080/slide"; in the command line client
>>
>
> When I try to mkcol after open the url I get this message:
>
> [ Slide ] $ open http://localhost:8080/slide
> [LOCALHOST] /slide/ $ ls
> files
> [LOCALHOST] /slide/ $ mkcol test
> Making '/slide/test' collection: failed.
> Forbidden (403)
> [LOCALHOST] /slide/ $
>
> Indeed when I try to run the SimpleClient.java I get this error
> message:
>
> classes% java SimpleClient
> Reopen connection : Host:localhost Port:8080
>
> MKCOL /slide/newpath HTTP/1.1
> Content-Length: 0
> Host: localhost:8080
> User-Agent: Jakarta HTTP Client/1.0
>
>
> HTTP/1.0 403 Forbidden
> Set-Cookie2: JSESSIONID=yreq6zfty1;Version=1;Discard;Path="/slide"
> Set-Cookie: JSESSIONID=yreq6zfty1;Path=/slide
> Servlet-Engine: Tomcat Web Server/3.2.3 (JSP 1.1; Servlet 2.2; Java
> 1.2; SunOS 5.7 sparc; java.vendor=Sun Microsystems Inc.)
>
> Closing connection
> End session
> Closing connection
> classes%
>
> Is something wrong with my setting. Every time I receive 403 Forbidden
> error.

Actually, you have to do the same thing I said to Kumar:
 I think I'll make a FAQ item for this... :-)

you have to give more permissions to guest
add the following line in domain.xml
          <permission action="/actions" subject="/users/guest" />
after:
        <objectnode classname="org.apache.slide.structure.SubjectNode"
uri="/files">

I'll attach a changed domain.xml

A second thing is that you normally don't put files in /slide, you put
them in /slide/files.
(look at my example it makes a /slide/files/newpath )

If you want to check your permissions you can always use the "acl"
command:
[ Slide ] $ open htpp://localhost:8080/slide
[LOCALHOST] /slide/ $ acl

ACL for /slide:
------------------------------------------------------------
granted to /slide/root    (not protected)   (not inherited)
   DAV:all
granted to /slide/user    (not protected)   (not inherited)
   DAV:read
granted to all    (not protected)   (not inherited)
   DAV:read
------------------------------------------------------------
[LOCALHOST] /slide/ $ cd files
[LOCALHOST] /slide/files/ $ acl

ACL for /slide/files/:
------------------------------------------------------------
granted to /slide/users/guest    (not protected)   (not inherited)
   DAV:all
granted to /slide/users/john    (not protected)   (not inherited)
   DAV:read-acl
   DAV:write-acl
granted to /slide/%2B/users/groupA    (not protected)   (not inherited)
   DAV:write
granted to all    (not protected)   (not inherited)
   DAV:read
granted to /slide/root    (protected)   (inherited from '/slide/')
   DAV:all
------------------------------------------------------------
[LOCALHOST] /slide/files/ $ mkdir newpath
Making '/slide/files/newpath' collection: succeeded.
[LOCALHOST] /slide/files/ $ cd newpath
[LOCALHOST] /slide/files/newpath/ $ acl

ACL for /slide/files/newpath/:
------------------------------------------------------------
granted to /slide/users/guest    (protected)   (inherited from
'/slide/files')
   DAV:all
granted to /slide/users/john    (protected)   (inherited from
'/slide/files')
   DAV:read-acl
   DAV:write-acl
granted to /slide/%2B/users/groupA    (protected)   (inherited from
'/slide/files')
   DAV:write
granted to all    (protected)   (inherited from '/slide/files')
   DAV:read
granted to /slide/root    (protected)   (inherited from '/slide/')
   DAV:all
------------------------------------------------------------
[LOCALHOST] /slide/files/newpath/ $ put a.html
Uploading  'a.html' to '/slide/files/newpath/a.html': succeeded.
[LOCALHOST] /slide/files/newpath/ $ ls -l
a.html                    2590  text/html            Aug 14, 2001
12:02:02 AM
[LOCALHOST] /slide/files/newpath/ $ acl a.html

ACL for /slide/files/newpath/a.html:
------------------------------------------------------------
granted to /slide/users/guest    (protected)   (inherited from
'/slide/files')
   DAV:all
granted to /slide/users/john    (protected)   (inherited from
'/slide/files')
   DAV:read-acl
   DAV:write-acl
granted to /slide/%2B/users/groupA    (protected)   (inherited from
'/slide/files')
   DAV:write
granted to all    (protected)   (inherited from '/slide/files')
   DAV:read
granted to /slide/root    (protected)   (inherited from '/slide/')
   DAV:all
------------------------------------------------------------
[LOCALHOST] /slide/files/newpath/ $


If you don't use authentication you are "/slide/users/guest"
with the modification in domain.xml you get all permissions on
/slide/files
and you can do what you want...


Dirk
<?xml version="1.0"?>

<slide logger="org.apache.slide.util.logger.SimpleLogger" logger-level="6" default="slide">

<!--
logger
~~~~~~
org.apache.slide.util.logger.SimpleLogger 
   default logger with 1 log level
log4j.Log4jLogger 
   logger with fine granularity
   see http://jakarta.apache.org/log4j/

logger-level 
~~~~~~~~~~~~
0 EMERGENCY
1 CRITICAL
2 ERROR
4 WARNING
6 INFO
7 DEBUG
-->

  <namespace name="slide">
<!-- ### Memory Configuration ###
     The following memory configuration uses the MemoryDescriptorsStore
     for node,security,locks and revisions. For content the FileContentStore
     is used. Content is reset before start.
-->
    <definition>
      <store name="memory">
        <nodestore classname="slidestore.reference.MemoryDescriptorsStore">
        </nodestore>
        <securitystore>
          <reference store="nodestore" />
        </securitystore>
        <lockstore>
          <reference store="nodestore" />
        </lockstore>
        <revisiondescriptorsstore>
          <reference store="nodestore" />
        </revisiondescriptorsstore>
        <revisiondescriptorstore>
          <reference store="nodestore" />
        </revisiondescriptorstore>
        <contentstore classname="slidestore.reference.FileContentStore">
          <parameter name="rootpath">contentstore</parameter>
          <parameter name="version">false</parameter>
          <parameter name="resetBeforeStarting">true</parameter>
        </contentstore>
      </store>
      <scope match="/" store="memory" />
    </definition>


<!-- ### JDBC Configuration ###
     The following jdbc sample configuration uses the hsql Database Engine
     a relational database engine written in Java, for more info: 
     http://hsqldb.sourceforge.net/ 
-->
<!--
    <definition>
      <store name="jdbc">
        <nodestore classname="slidestore.reference.JDBCDescriptorsStore">
         <parameter name="driver">org.hsqldb.jdbcDriver</parameter>
         <parameter name="url">jdbc:hsqldb:slidestructure</parameter>
         <parameter name="user">sa</parameter>
         <parameter name="password"></parameter>
        </nodestore>
        <securitystore>
          <reference store="nodestore" />
        </securitystore>
        <lockstore>
          <reference store="nodestore" />
        </lockstore>
        <revisiondescriptorsstore>
          <reference store="nodestore" />
        </revisiondescriptorsstore>
        <revisiondescriptorstore>
          <reference store="nodestore" />
        </revisiondescriptorstore>
        <contentstore classname="slidestore.reference.JDBCContentStore">
         <parameter name="driver">org.hsqldb.jdbcDriver</parameter>
         <parameter name="url">jdbc:hsqldb:slidecontent</parameter>
         <parameter name="user">sa</parameter>
         <parameter name="password"></parameter>
        </contentstore>
      </store>
      <scope match="/" store="jdbc" />
    </definition>
-->


    <configuration>

      <!-- Actions mapping -->
      <default-action>/actions</default-action>
      <read-object>/actions/read</read-object>
      <create-object>/actions/write</create-object>
      <remove-object>/actions/write</remove-object>
      <grant-permission>/actions/manage</grant-permission>
      <revoke-permission>/actions/manage</revoke-permission>
      <read-permissions>/actions/manage</read-permissions>
      <lock-object>/actions/write</lock-object>
      <kill-lock>/actions/manage</kill-lock>
      <read-locks>/actions/read</read-locks>
      <read-revision-metadata>/actions/read</read-revision-metadata>
      <create-revision-metadata>/actions/write</create-revision-metadata>
      <modify-revision-metadata>/actions/write</modify-revision-metadata>
      <remove-revision-metadata>/actions/write</remove-revision-metadata>
      <read-revision-content>/actions/read</read-revision-content>
      <create-revision-content>/actions/write</create-revision-content>
      <modify-revision-content>/actions/write</modify-revision-content>
      <remove-revision-content>/actions/write</remove-revision-content>

      <!-- Paths configuration -->
      <userspath>/users</userspath>
      <guestpath>guest</guestpath>
      <filespath>/files</filespath>
      <parameter name="dav">true</parameter>
      <parameter name="standalone">true</parameter>

      <!-- Roles definition -->
      <role name="root">slideroles.basic.RootRole</role>
      <role name="user">slideroles.basic.UserRole</role>
      <role name="guest">slideroles.basic.GuestRole</role>

      <!-- Users management -->
      <auto-create-users>true</auto-create-users>

      <!-- Default properties mapping -->
      <default-property name="foo" namespace="nsfoo/" value="bar"
       role="user"/>
      <default-property name="password" namespace="slide/" value=""
       role="user"/>

    </configuration>
    
    <data>
      
      <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/">
        
        <permission action="/actions" subject="root"/>
        <permission action="/actions/read" subject="user"
         inheritable="false"/>
        <permission action="/actions/read" subject="nobody"
         inheritable="false"/>
        
        <!-- /users represents the unauthenticated user -->
        
        <objectnode classname="org.apache.slide.structure.SubjectNode" 
         uri="/users">
          
          <permission action="/actions" subject="~"/>
          <permission action="/actions" subject="guest"
           inheritable="true" negative="true"/>
          <permission action="/actions/read" subject="user"
           inheritable="false"/>

          <!-- Permission group example -->
          
          <objectnode classname="org.apache.slide.structure.GroupNode" 
            uri="/users/groupA">
             <objectnode classname="org.apache.slide.structure.LinkNode" 
                uri="/users/groupA/john" linkedUri="/users/john" />
             <objectnode classname="org.apache.slide.structure.LinkNode" 
                uri="/users/groupA/root" linkedUri="/users/root" />
             <objectnode classname="org.apache.slide.structure.SubjectNode" 
               uri="/users/groupA/singleGroupMember"  />
          </objectnode>

          <!-- /users/root represents the administrator -->
          
          <objectnode classname="slideroles.basic.RootRoleImpl" 
           uri="/users/root">
            <revision>
              <property name="password">root</property>
            </revision>
          </objectnode>
          
          <!-- /users/john represents an authenticated user -->
          
          <objectnode classname="slideroles.basic.UserRoleImpl" 
           uri="/users/john">
            <revision>
              <property name="password">john</property>
            </revision>
          </objectnode>
          
          <!-- /users/guest represents an authenticated or unauthenticated 
               guest user -->
          
          <objectnode classname="slideroles.basic.GuestRoleImpl" 
           uri="/users/guest">
            <revision>
              <property name="password"></property>
            </revision>
          </objectnode>
          
        </objectnode>
        
        <objectnode classname="org.apache.slide.structure.ActionNode" 
         uri="/actions">
          
          <objectnode classname="org.apache.slide.structure.ActionNode" 
           uri="/actions/read"/>
          
          <objectnode classname="org.apache.slide.structure.ActionNode" 
           uri="/actions/write"/>
          
          <objectnode classname="org.apache.slide.structure.ActionNode" 
           uri="/actions/manage"/>
          
        </objectnode>
        
        <objectnode classname="org.apache.slide.structure.SubjectNode" 
         uri="/files">

          <permission action="/actions" subject="/users/guest"/>
          
          <permission action="/actions/manage" subject="/users/john"/>
          <permission action="/actions/write" subject="+/users/groupA"/>
          <permission action="/actions/read" subject="nobody"/>
          
        </objectnode>
        
      </objectnode>
      
    </data>
    
  </namespace>
  
</slide>

Reply via email to