Access control for multiple projects using SVN

svn

I am new to SVN and trying to configure access control for multiple projects on SVN. I want to use a single password file and a single authentication file for access control for all the projects. But, it isn't working. Below is my configurations.
My directory structure:

/srv
|--svn
   |--repos
      |-- conf
          |-- passwd
          |-- authz
      |-- projectX
      |-- projectY
      |-- projectZ

projectX/conf/svnserve.conf entries for projectX:

[general]
anon-access = none
auth-access = write
password-db = /srv/svn/repos/conf/passwd
authz-db = /srv/svn/repos/conf/authz
realm = Project Repository

Same configuration is used for projectY and projectZ.
Entries for /srv/svn/repos/conf/passwd:

[users]
user1 = password
user2 = password
user3 = password

Entries for /srv/svn/repos/conf/authz:

[/]
* = 
user1 = rw
[projectX:/]
user2 = rw
user3 = r
[projectY:/]
user3 = rw
user2 = r
[projectZ:/]
user2 = r
user3 = r

So, user2 should have read-write access to projectX and user3 should have read-only access to projectX. But, only user1 can access all these repositories. user2 and user3 can never access any of the repositories. Every time it gives the error message: Commit failed (Authorization failed!)
Can anyone please help me finding my error?
I am using version 1.6.5 of Subversion on the server and 1.6.4 on the client.

Best Answer

I've successfully used this structure with Subversion 1.4:

Subversion
|-- Config
    |-- a-users
    |-- b-users
|--Repositories
    |-- x-repos
        |-- conf
            |-- svnserve.conf
    |-- y-repos
        |-- conf
            |-- svnserve.conf

... where the svnserve.conf files contained a line like this:

password-db = ../../../Config/a-users

This way I can use one password-db file for any number of repositories or I can have a separate password-db file for each repository.

If you are using Subversion > 1.4, you'll need to to take a look at how configuration has changed in newer versions. One point is that, at least in 1.4, relative paths do work. Hope this helps.

Update: I'm on unix (Mac OS X).

Related Topic