问题
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