Subversion mod_dav安装方式下的权限控制
先来个最简单的认证方式--使用Apache的认证,首先建立Apache的passwd文件:
htpasswd -c -s apache_passwd Fwolf
-c为新建文件,下次添加用户的时候就不用这个参数了,-s为使用SHA算法加密密码。然后,在apache的httpd.conf中的<Location /svn>段增加如下几句:
AuthType Basic
AuthName "Fwolf’s Subversion repositories"
AuthUserFile h:/svn/svnpasswd
#AuthzSVNAccessFile h:/svn/svnaccessfile
Require valid-user
然后重启Apache。现在使用TortoiseSVN和http访问svn的Repository就都要求输入用户名密码了。
如果想把浏览权放开,只限制更新的时候进行认证,可以把Require valid-user改为
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
这样匿名用户就可以浏览了。如果想要更进一步、更细致的权限控制,可以在使用上述方法验证用户身份的基础上,使用SVNAccessFile限定用户的操作范围。
首先把
#AuthzSVNAccessFile h:/svn/svnaccessfile
的注释取消,然后按照如下格式建立accessfile即可
[groups] developers = user1,user2,user3,user4 docs = user5,user6,user7 #to allow everyone read access [/] * = r #allow all developers complete access @developers = rw #give the doc people write access to the docs folder [project:/trunk/doc] @docs = rw
在accessfile中,可以定义用户组,可以针对全局或者某个Repository甚至它的某个子目录指定权限。
原帮助中的对[/project/trunk/doc]指定权限的方式,好像在SVNParentPath模式下不可用,把名称格式改一下就可以了。
7.14
![[Bloglines]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/bloglines.png)
![[del.icio.us]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/digg.png)
![[diigo]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/diigo.png)
![[Facebook]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/facebook.png)
![[Google]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/google.png)
![[MySpace]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/myspace.png)
![[Reddit]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/reddit.png)
![[Slashdot]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/slashdot.png)
![[Email]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/email.png)