2009-11-11 47 views
0

有主Mercurial库(一个)有2个文件夹“depot1”和“depot2”在Windows机器我如何配置ACL扩展多用户访问控制设置在Mercurial库

以下配置中完成的。 hg/hgrc文件A回购。

[ui] 
username = praveen 

[extensions] 
hgext.acl= 

[hooks] 
changegroup.update = hg update 
pretxnchangegroup.acl = python:hgext.acl.hook 

[acl] 
sources = serve push pull commit 

然后创建的水银库2个克隆。 X在Windows机器上

X .hg/hgrc文件ÿ是:

[ui] 
username = clone1 

Ÿ .hg/hgrc文件是:

[ui] 
username = clone2 

My Question: 
1- Restrict all push operations from user="clone2". 
2- user="clone1" will be able to perform push on only "depot1". 

请建议我怎么这个配置是可能的。

感谢,

普利文

回答

5

不幸的是,你误会在[ui]部分username做什么。这是严格的客户端设置,如果“如果服务器要求我输入用户名以进行身份​​验证,我想发送”,那么您在回购A,X和Y中的ui.username中所拥有的内容不会影响远程用户可以访问/使用这些存储库。

相反,您需要使用Y和X存储库的.hg/hgrc文件中的[acl.allow][acl.deny]部分来为它们指定访问控制。

您在示例中使用的用户名('clone1'和'clone2')需要真实身份验证系统支持。内置的hg-serve不提供一个,所以你需要使用ssh或Apache/ISS与hgweb或hgwebdir。请参阅publishing repositories wiki page了解详情。

+0

您可以请参阅任何有关如何配置汞金属储存库[acl.allow]/[acl.deny]和[allow_push]的好文档。 – praveen 2009-11-12 07:25:38

+2

AclExtension wiki页面http://mercurial.selenic.com/wiki/AclExtension解释了[acl.allow]和[acl.deny]。 但是,您需要了解的是,mercurial没有自己的用户数据库。它使用您的(1)操作系统,(2)ssh authorized_keys或(3)HTTP Web服务器身份验证领域的用户系统。它使用的取决于你如何访问mercurial(ssh或http)。 你使用ssh:URLs还是http:URLs?你在哪里创建你的用户帐户? – 2009-11-12 17:39:08

+0

我在Windows机器上安装了mercurial,并且当前使用hg serve发布我的单个mercurial存储库。 克隆存储库(每个用户在其本地Windows机器上都有一个克隆) – praveen 2009-11-13 10:32:35

相关问题