SVN - User directory permissions

Matt picture Matt · Sep 16, 2010 · Viewed 16.3k times · Source

I'm using SVN (CollabNet Subversion Edge) and Tortoise SVN to manage a website being edited by multiple people.

I'd like to limit access by some users to some directories (to prevent them seeing database credentials etc). They only require read access to one directory.

Is it possible to do this in SVN?

Thanks!

Edit

They are running a mix of XP and Windows 7. The server is on Windows 2008. The protocol being used is http.

Answer

Critical Skill  picture Critical Skill · Sep 20, 2010

This can be achieved by using the svnaccess.conf file. Assuming you use windows domain authentication, here is one way to provide folder-level access to windows users. (a sample section of the svnaccess.conf file)

[repo:/trunk/samplefolder]

*=

@repo_restricted_users = r

@repo_super_users = rw

Here, repo_restricted_users and repo_super_users are user groups which must be defined earlier in the svnaccess.conf file - thus:

repo_restricted_users = john.doe, tom.riddle

repo_super_users = harry.potter, lord.voldemort

This will provide read access to just the folder samplefolder within the repository while keeping other folders closed. Hope this helps.