3

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
Montag451
  • 1,168
  • 3
  • 14
  • 30
Ozzie
  • 11,613
  • 4
  • 21
  • 24

1 Answers1

3

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

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
  • @Ozzie - add at least r for everybody in root section, your old `[/] * = r` – Lazy Badger Jan 09 '13 at 05:08
  • @Ozzie - not "necessary", but *slightly manageable* - if you'll have user, not included in group1, it will have no access (if memory serves me well) in your config without additional work. – Lazy Badger Jan 10 '13 at 19:39
  • Ah you mean if the server had more repositories and users with no restrictions on it? This is not the case, all the users are in groups and all the repositories defined in the configuration. But it's good to know for future use. – Ozzie Jan 10 '13 at 19:45