SVN - how to restrict user access to certain folders?
Solution 1
Add the following text to your authz specifying a user by name for path-based authorization (<reponame>
can be the name of any repository).
[<reponame>:/branches/calc/bug-142/secret]
harry =
To give Harry readonly access to the secret folder then do the following.
[<reponame>:/branches/calc/bug-142/secret]
harry = r
These will specifically deny a user from having any less restrictive inherited permissions.
Solution 2
Path-based authorization should help you. Authorization mechanisms are built in Apache Subversion.
As @jpierson already answered, you can use authz
files to define No Access, Read Only or Read Write rules on repository paths. Repository path can represent repository root and any path within repository. I.e. you can specify access rules not only subtrees (folders) but files as well.
Related videos on Youtube
StackOverflowNewbie
Updated on July 09, 2022Comments
-
StackOverflowNewbie almost 2 years
I have an SVN repository wherein I need to give a particular user read/write access to several specific folders. Access to the folder and its children is OK, but accessing the folder's parent is not OK.
Also, it's actually 2 separate folders I need this user to access -- and these 2 folders are not part of the same tree node (but eventually they are if you go up enough levels).
I have access to SVN's
/conf/authz
,/conf/passwd
, and/conf/svnserve.conf/
files. -
Xdg over 10 yearscalc is a name of repository :)
-
jpierson over 9 years@Xdg, I guess I could have used helloworld or todo instead of calc.
-
QFDev almost 8 years
authz
file is ignored by default so you will need to addauthz-db = authz
to thesvnserve.conf
file so that your new auth settings will be invoked. Knowing this would have saved me about 30 mins :)