In gitolite, any easier way to create exceptions to users of @all?

自作多情 提交于 2019-12-08 04:57:17

问题


For instance, in the repo PRJ, there are several groups, like @A1 @A2 @B1 @B2, UserX is in group @B1.

Now I want to add one rule for UserX, only allow him to modify the code in src/ folder, but do not apply this rule to others.
Is there any easier way to implement it?

@B1 = UserX UserY UserZ
repo    PRJ
    R               =   @A1 @A2
    RW+             = @B1 @B2
    RW   NAME/      = @A1 @A2 @B2 UserY UserZ
    #RW  NAME/      =   @all-UserX # like this?
    RW   NAME/src/  =   UserX
    -    NAME/      =   UserX

回答1:


Gitolite follows a system of rule of accumulation

for each user+repo combination, several rules will apply.
Gitolite combines them all into one list (in the sequence they are found in the conf file), before applying the access checks.

for options and config lines, a later setting overrides earlier ones

There is a way of making deny rules easier to manage with the deny-rules directive, but it doesn't apply in your case.

This is closer to the rules you see in a delegation mechanism, and would be adapted in something like (not tested)

repo Prj
    R                   = @A1 @A2
    RW+                 = @B1 @B2
    RW  VREF/NAME/src   = UserX
    -   VREF/NAME/src   = @all


来源:https://stackoverflow.com/questions/16249940/in-gitolite-any-easier-way-to-create-exceptions-to-users-of-all

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!