Subversion Authz config on Apache

3k Views Asked by At

I'm trying to restrict the access to my subversion repositories to certain users. However I can't get it to work the way I want.

I have three repositories. Let's call them repo1, repo2 and repo3. I also have three users. user1, user2 and user3.

What I want is that all the users to read/write to repo1 and only user1 read/write repo2 and repo3. I don't want user2 and 3 to be able to read repo2 and repo3. Now I thought that the following configuration should work:

[groups]
group1 = user1, user2, user3

[/repo1]
@group1 = rw

[/repo2]
@group1 = 
user1 = rw

[/repo3]
@group1 =
user1 = rw

[/]
* = r

However, with this configuration user2 and user3 can still access all repo's and none of the users is allowed to commit/change any files.

Can anyone tell me what I do wrong?

Edit

Thanks to the correct answer I've got it working. Might be useful for other users.

[groups]
group1 = user1, user2, user3

[repo1:/]
@group1 = rw

[repo2:/]
user1 = rw

[repo3:/]
user1 = rw
1

There are 1 best solutions below

3
Lazy Badger On

Definition of repo in sections

From SVN Book

If you're using the SVNParentPath directive, it's important to specify the repository names in your sections. If you omit them, a section such as [/some/dir] will match the path /some/dir in every repository.

Section format is well documented:

the value of the section names is either of the form [repos-name:path] or of the form [path]

I.e your [/repoN] define path /repoN inside every and each repo, not repository. Use [repoN:/] for appropriate repository's root