使用SVN对多个项目进行访问控制

编程入门 行业动态 更新时间:2024-10-11 21:32:25
本文介绍了使用SVN对多个项目进行访问控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是 SVN 的新手,正在尝试为 SVN 上的多个项目配置访问控制.我想使用单个密码文件和单个身份验证文件对所有项目进行访问控制.但是,它不起作用.下面是我的配置.我的目录结构:

I am new to SVN and trying to configure access control for multiple projects on SVN. I want to use a single password file and a single authentication file for access control for all the projects. But, it isn't working. Below is my configurations. My directory structure:

/srv |--svn |--repos |-- conf |-- passwd |-- authz |-- projectX |-- projectY |-- projectZ

projectX/conf/svnserve.conf 项目 X 的​​条目:

projectX/conf/svnserve.conf entries for projectX:

[general] anon-access = none auth-access = write password-db = /srv/svn/repos/conf/passwd authz-db = /srv/svn/repos/conf/authz realm = Project Repository

projectY 和 projectZ 使用相同的配置./srv/svn/repos/conf/passwd 的条目:

Same configuration is used for projectY and projectZ. Entries for /srv/svn/repos/conf/passwd:

[users] user1 = password user2 = password user3 = password

/srv/svn/repos/conf/authz 的条目:

Entries for /srv/svn/repos/conf/authz:

[/] * = user1 = rw [projectX:/] user2 = rw user3 = r [projectY:/] user3 = rw user2 = r [projectZ:/] user2 = r user3 = r

因此,user2 应该对 projectX 具有读写访问权限,user3 应该对 projectX 具有只读访问权限.但是,只有 user1 可以访问所有这些存储库.user2 和 user3 永远不能访问任何存储库.每次它都给出错误消息:提交失败(授权失败!)任何人都可以帮我找到我的错误吗?我在服务器上使用 Subversion 1.6.5 版,在客户端上使用 1.6.4 版.

So, user2 should have read-write access to projectX and user3 should have read-only access to projectX. But, only user1 can access all these repositories. user2 and user3 can never access any of the repositories. Every time it gives the error message: Commit failed (Authorization failed!) Can anyone please help me finding my error? I am using version 1.6.5 of Subversion on the server and 1.6.4 on the client.

推荐答案

我已经在 Subversion 1.4 中成功地使用了这个结构:

I've successfully used this structure with Subversion 1.4:

Subversion |-- Config |-- a-users |-- b-users |--Repositories |-- x-repos |-- conf |-- svnserve.conf |-- y-repos |-- conf |-- svnserve.conf

... 其中 svnserve.conf 文件包含这样一行:

... where the svnserve.conf files contained a line like this:

password-db = ../../../Config/a-users

这样我可以为任意数量的存储库使用一个 password-db 文件,或者我可以为每个存储库使用一个单独的 password-db 文件.

This way I can use one password-db file for any number of repositories or I can have a separate password-db file for each repository.

如果您使用的是 Subversion > 1.4,则需要查看新版本中的配置发生了哪些变化.一点是,至少在 1.4 中,相对路径确实有效.希望这会有所帮助.

If you are using Subversion > 1.4, you'll need to to take a look at how configuration has changed in newer versions. One point is that, at least in 1.4, relative paths do work. Hope this helps.

更新:我使用的是 unix (Mac OS X).

Update: I'm on unix (Mac OS X).

更多推荐

使用SVN对多个项目进行访问控制

本文发布于:2023-11-08 06:44:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1568632.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   访问控制   项目   SVN

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!