开发者

Restricting access to SVN for some users

All of my code is on my SVN, but I want some of it to be inaccessible to a freelancer开发者_运维百科 I'm planning to hire. That said, there are many directories, and I want the other person — who I have never met — to be able to access only certain directories, for both reading and writing.

I can't find a way to do this in SVN, other than using DAV (hell) or a pre-commit hook. How can I prevent somebody else from reading the entire tree?

I know I can create another repository, but I do not wish to do that.


In your repository’s authz file, set it up like

[/]
me = rw
freelancer =

to prevent the freelancer from reading the root.

Then, for each directory you want to give him or her access to, put an entry explicitly granting it, like

[/freelancerStuff]
freelancer = rw

Here’s the documentation that describes it further.


I must admit that my understanding of SVN is greatly debilitated by the lovely point-and-click VisualSVN Server :) but there, I can set permissions freely for each sub-directory. Seeing as VisualSVN is only a wrapper around the normal svn binaries, I would assume that this is definitely possible.

Update: It's definitely possible in plain SVN. Here's an article that describes setting it up in detail.


I use VisualSVN server with its active directory integration. Restricting access involves clicking on the appropriate directories in the mmc snapin and changing the access permissions. You can do the same using the native svn user permissions.

If you're running on Linux, install a management website such as submin or usvn, and use that to put the same kind of permissions on various parts of the tree.


Okay. This is weird.

I had everything configured. I guess I researched this a year ago and totally forgot.

To whoever has the same problem. Upgrade your SVN to 1.6, and use authz-db file in your svnserve.conf. There is no need to install WebDAV or authz shared object for apache. This works directly from svn serve.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜