gitolite或gitosis:存储库内目录的权限 [英] gitolite or gitosis: permission on directory inside of the repository

查看:128
本文介绍了gitolite或gitosis:存储库内目录的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如:我有一个存储库 - 带有这样的fs层次结构的repo1

  repo1:
js
html
php / core
php / menu

我想给到 repo1:php / menu ,RW权限 - 给自由职业者,但对于所有repo1 - 这位自由职业者必须只有只读权限。



我可以使用gitolite或gitosis来做到这一点,或者可以使用其他方法吗?

解决方案

在DVCS上总是链接到所有的回购,而不是如果,主要是因为你克隆它的所有它(浅克隆很难)。



这意味着 gitolite (我甚至不会提到过时的gitosis)可以对以下方面设定限制:




  • 访问全部回购

  • 仅写入某些分支(但不能限制对某个分支的读取访问)


    不能阻止用户访问部分回购



    但是,由于 gitolite v3或'g3'(2012年4月17日),您可以通过 VREF规则,阻止 写入(推送)某些目录 (除了某些分支)。




    原始答案( gitolite V2或'g2',2011年11月)



    请参阅 gitolite.conf - 通过示例侧注:R权限为参考

     回购gitolite-admin 
    RW + = sitaram
    #这相当于:
    RW + ref。/.* = sitaram




    Sitaram是唯一的管理员。他可以推送,创建,删除或倒回gitolite-admin回购中的任何分支或标记。



      R master = wally#MEANINGLESS!不会做你认为它做的事! 




    这不起作用。

    您只能在回购级别限制读取访问权限,而不能在分支级别

    这是一个git问题,而不是gitolite问题。去打扰他们,或者切换到gerrit。



    For example: I have a repository - repo1 with such fs hierarchy

    repo1:
     js
     html
     php/core
     php/menu
    

    And I want to give to repo1:php/menu, RW permission - to a freelancer, but for all repo1 - this freelancer must have only Read-Only permission.

    Can I do this with gitolite or gitosis or may be something else?

    解决方案

    The repo access rights on a DVCS is always linked to the all repo, not part of if, mainly because you clone all of it (shallow clone is hard).

    That means gitolite (I won't even mention gitosis which is obsolete) can establish restrictions on:

    • accessing a all repo
    • writing only certain branches (but you cannot limit read access to certain branch)

    But it cannot prevent a user to access parts of a repo.

    However, since gitolite v3 or 'g3' (April 17th, 2012), you can, with VREF rules, prevent writing (pushing to) certain directories (in addition of certain branches).


    Original answer (gitolite V2 or 'g2', November 2011)

    See gitolite.conf -- by example and side note: "R" permissions for refs

    repo    gitolite-admin
            RW+                 =   sitaram
            # this is equivalent to:
            RW+     refs/.*     =   sitaram
    

    Sitaram is the only admin. He can push, create, delete, or rewind any branch or tag in the gitolite-admin repo.

            R master    =   wally       # MEANINGLESS!  WILL NOT DO WHAT YOU THINK IT DOES!
    

    This won't work.
    You can only restrict "read" access at the repo level, not at the branch level.
    This is a git issue, not a gitolite issue. Go bother them, or switch to gerrit.

    这篇关于gitolite或gitosis:存储库内目录的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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