gitolite 不允许访问主分支上的目录,但不允许访问用户分支上的目录 [英] gitolite disallow access for directory on master branch but not on user branch

查看:15
本文介绍了gitolite 不允许访问主分支上的目录,但不允许访问用户分支上的目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑以下回购:

REPO/src/A/

REPO/src/A/

REPO/src/B/

REPO/src/B/

是否可以通过只有 1 个 repo 来实现以下限制?

Is it possible by having only 1 repo to implement the following restrictions?

  1. 在 master 分支上,允许完全访问维护者角色
  2. 在 master 分支上,禁止访问 A,但允许 B 担任贡献者角色.
  3. 在个人分支上,允许创建者完全访问 A 和 B.

推荐答案

使用 Gitolite V3 或'g3' 及其 VREF,应该可以实现这些限制.

With Gitolite V3 or 'g3' and its VREF, it should be possible to implement those restrictions.

但您可以管理的访问权限仅适用于写访问权限.
如果用户可以克隆一个 repo,他/她将拥有对 repo all 的读取权限(如gitolite:只允许更改选定的文件").
如果你真的想限制读取权限,你可以试试 gitolite '<代码>部分复制'.

But the access you can manage is only for write-access.
If a user can clone a repo, he/she will have read-access to all the repo (as mentioned in "gitolite: allow to change only selelected files").
If you really want to limit read-access, you might try gitolite 'partial-copy'.

几点说明:

访问规则如下:

<permission> <zero or more refexes> = <one or more users/user groups>

<零个或多个 refexes> 表示您可以结合 refexes

<zero or more refexes> means your can combines refexes

这将给出类似(未测试):

That would give something like (not tested):

repo REPO
        RW+  master                     =   MAINTAINER
        -    master         VREF/NAME/A =   CONTRIBUTOR
        RW   master         VREF/NAME/B =   CONTRIBUTOR
        RW   personal/USER/ VREF/NAME/A =   CREATOR
        RW   personal/USER/ VREF/NAME/B =   CREATOR

这篇关于gitolite 不允许访问主分支上的目录,但不允许访问用户分支上的目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆