SVN - how to restrict user access to certain folders?

北战南征 提交于 2019-11-27 01:19:09

问题


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.


回答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.




回答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.

Read SVNBook!



来源:https://stackoverflow.com/questions/6091743/svn-how-to-restrict-user-access-to-certain-folders

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!