2012-05-18 21 views

回答

3

您可以使用svn authz文件設置權限。首先,我們需要創建一個訪問控制文件。

sudo nano /etc/apache2/svn_access_control 

用戶組

您可以創建用戶組,然後用那些規則。你這樣做在方括號中一個特殊的標題下:

[groups] 
mygroup = dave, mike 

這將創建一個名爲「MYGROUP」這組「大衛」和「麥克風」屬於。

現在爲一些例子。例如

[groups] 
team = bob, bill devteam = bob, barry, brett 
[/] 
@team = r bob = rw 
[/wowapp/trunk] 
@team = r @devteam = rw brenda = rw 

在這個例子中:

Created a group team which has two members; bob and bill. 
Created another group, called devteam which has three members; bob, barry, brett. 
In the root of the repository, I’ve given the group team read permissions. 
Also, in the root, bob has read and write permissions. 
In the trunk of wowapp, the group team has read permission. 
Also, the devteam group has read and write permissions. 
And another user, called brenda has read and write permissions. 

你需要補充的是在Apache的SVN配置文件中的以下行。

AuthzSVNAccessFile /etc/apache2/svn_access_control 

,使文件看起來像這樣:

<Location /svn> 
    DAV svn 
    SVNPath /home/svn 

    AuthType Basic 
    AuthName "Subversion Repository" 
    AuthUserFile /etc/apache2/dav_svn.passwd 

    AuthzSVNAccessFile /etc/apache2/svn_access_control 

    Require valid-user 
</Location> 

保存文件,然後重新啓動的Apache2:

sudo /etc/init.d/apache2 restart 

你現在應該有訪問控制顛覆了Apache2的工作。

-1

對於每個目錄驗證的訪問請參閱redbean書的auth section

如果您想要更容易的事情,可以使用GUI來設置訪問權限,例如uberSVN

相關問題