You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ron Avriel <ra...@hotmail.com> on 2006/01/22 16:16:51 UTC

How to restrict access to repository directory?

Hi,

How can I restrict write access to a repository directory (and its
files and directories) to specific users?

I tried using svnperms.py and and commit-access-control.pl from
the pre-commit hook, but I couldn't get any of them to work right.

For svnperms.py I configured svnperms.conf:
-------------------------------------
[my-repo]
trunk/.* = *(add,remove,update)
trunk/restricted.* = admin(add,remove,update)
-------------------------------------

but with this configuration everyone had write accesses
to trunk/restricted.

For commit-access-control.pl I configured commit-access-control.cfg:
-------------------------------------
[Make everything read-only for all users]
match   = .*
access  = read-only

[Everyone has access to trunk]
match = ^trunk/.*
access = read-write

[Only admin has access to trunk/restricted]
match = ^trunk/restricted.*
access = read-write
users = admin
-------------------------------------

but again with this configuration everyone had write accesses to
trunk/restricted.

Any help will be greatly appreciated,
Ron

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: How to restrict access to repository directory?

Posted by Paul Koning <pk...@equallogic.com>.
>>>>> "Ron" == Ron Avriel <ra...@hotmail.com> writes:

 Ron> Hi, How can I restrict write access to a repository directory
 Ron> (and its files and directories) to specific users?

 Ron> I tried using svnperms.py and and commit-access-control.pl from
 Ron> the pre-commit hook, but I couldn't get any of them to work
 Ron> right.

 Ron> For svnperms.py I configured svnperms.conf:
 Ron> ------------------------------------- 
 Ron> trunk/.* = *(add,remove,update)
 Ron> trunk/restricted.* = admin(add,remove,update)
 Ron> -------------------------------------

 Ron> but with this configuration everyone had write accesses to
 Ron> trunk/restricted.

svnperms.py says that the last match wins.  In the rule you gave, an
access to trunk/restricted.* will match both lines.  The first line
gives a rule for everyone.  The second line overrides that ONLY for
admin.  For non-admin, it doesn't give a rule.  So the previous rule
is still in effect.

What you need is this for the second line:
 trunk/restricted.* = *(),admin(add,remove,update)

That way your second line now says "everyone has no access -- except
admin who has full access".

By the way, I looked at both the Perl and Python based access controls
and ended up using the Python one because it seemed easier to use.  

    paul


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org