Svn – Configuring SVN Access with Subversion Server

authorizationpermissionssvn

Quick background. We are running Subversion Server 1.6.5 (No Apache just the SVN server) on a Windows box with no web access. We only use TortoiseSVN and AnkhSVN and for continuous integration we use the svn client command line.

OK, so I've looked around on the NET and read the SVN book a bit and I don't understand why this user setup does not work.

authz (SVN authorization file) contents:

    ### Sanitized version
    [groups]
    devUsers = user1
    qaUsers = user2

    [/]
    @devUsers = r
    @qaUsers = r

    [/Dev/SourceCode]
    @devUsers = rw
    ~devUsers = 

    ### QA Projects
    [/Dev/testCases]
    @qaUsers = rw
    ~qaUsers =

From what I've read, you have to grant all users at a minimum read access to the root of your repository. OK, fine. That works. Next up my /Dev/SourceCode directory should only be accessible to @devUsers, but for some reason in TortoiseSVN's repo-browser, @qaUsers can see this folder. I'm guessing the global read access on / is overriding the ~devUsers = line in the authz file? And same goes for the /Dev/TestCases folder that should only be accessible to @qaUsers, yet @devUsers can view this folder too. That's one of my problems.

The main problem though is that /Dev/SourceCode's subfolders are only read-only. I know this because when I attempt to check in something into a subfolder it says authorization failed. However, in the root folder, if you check in a file, it works fine.

I'm guessing this is the / read-only access overriding things again. Does this mean that each subfolder has to be given explicit rw permissions? Is there anyway to say from this point on use the current parent folder's permissions?, i.e. /Dev/SourceCode's permissions . This seems really inconvenient if you want to grant rw permissions to to all subfolders when there are many subfolders.

Best Answer

My initial thought when I saw your authorization file was, "aren't the repository names missing from the path declarations?"

By this I mean,

[/Dev/SourceCode]
@devUsers = rw
@qaUsers = 

should look like,

[<repo-name>:/Dev/SourceCode]
@devUsers = rw
@qaUsers = 

or, if `Dev' is the name of the repository,

[Dev:/SourceCode]
@devUsers = rw
@qaUsers = 

I use apache for our repositories, but the syntax looks the same whether it's httpd or svnserve: Path-Based Authorization

I hope this helps.

Thank you,
Zachary