I am using svnserve 1.4 running under Windows 7. I want to control user permissions by using an authz file.
I want to give the 'rw' permission to a subfolder while the root folder is read protected. I have a large repository and want to give 'rw' permissions for only a limited subset of the files. Other folders would be invisible to the user.
If I use the following configuration, nothing is displayed:
[/root]
group1 =
[/root/A/new/Data]
group1 = rw
[/root/C/Ex/Files]
group1 = rw
If I instead use:
[/]
group1 = rw
then all folders are visible to the "group1", which is not what I need.
Another option is doing something like
[root/B]
group1 =
[root/c]
group1 =
for all sub-folders that are not needed for group1. I'd rather not have to do it like this, though.
Note that if a user doesn't have read access to a folder, they can't access anything inside that folder. Without read access, Subversion doesn't have any way of knowing if there are files or folders inside of it for which it needs to check permissions. Denying read access will recursively hide a folder and everything inside of it.
If you find yourself in a situation where this type of fine-grained access control is necessary, I highly recommend re-evaluating your repository layout. If nested resources like your
/rootand/root/A/new/Dataneed such wildly different permissions, then it's likely that their relationship in the repo doesn't reflect their relationship in reality. Often times things like this will end up being re-organized into separate projects (or even separate repositories) instead of nested folders, and as a result most of the fine-grained access control work becomes greatly simplified.If you can't re-organize your repository without breaking build scripts, etc, then you may want to consider using Subversion's
svn:externalsproperty. You can move the contents of/root/A/new/Datainto a separate repository and give group1 full access to it. You can then usesvn:externalsto pull the new repository path into your/rootfolder under the same folder name, so that those with access to/rootsee the same thing when they dosvn checkout. This sort of workflow is useful when the contents of a sub-folder are something like a library that is delivered by an external team. You need to give the library team access to the library code (which they have by directly accessing the library's repository), but they don't need to have access to the rest of your code.