gitolite disallow access for directory on master branch but not on user branch

前端 未结 2 1665
长情又很酷
长情又很酷 2020-12-18 05:14

Consider the following repo:

REPO/src/A/

REPO/src/B/

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

  1. On m
2条回答
  •  心在旅途
    2020-12-18 05:38

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

    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'.

    Few notes:

    • VREF can be used for restricting pushes by dir/file name.
    • I use here the notion of role, not group of users: you need to set the permission separately for said users.
    • Personnal branches are described here.

    An access rule is like:

      = 
    

    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
    

提交回复
热议问题