get "info" for users other than yourself
if you have read access to the admin repo, you can say ssh git@server info user1 [...] Original idea and code by Karteek E. The motivation is to quickly and easily check what perms a user has. Technically nothing that you can't glean from the config file itself but it serves as a double check or a mild debugging aid perhaps. However note that the branch level rules are much more complex and they do not, as yet, have any such "helpful" aids. Life is like that sometimes.
This commit is contained in:
parent
a472bf30df
commit
1f9fbfa71e
|
@ -352,6 +352,14 @@ sub special_cmd
|
||||||
if ($cmd eq 'info') {
|
if ($cmd eq 'info') {
|
||||||
&report_basic($GL_ADMINDIR, $GL_CONF_COMPILED, $user);
|
&report_basic($GL_ADMINDIR, $GL_CONF_COMPILED, $user);
|
||||||
print "you also have shell access\n\r" if $shell_allowed;
|
print "you also have shell access\n\r" if $shell_allowed;
|
||||||
|
} elsif ($cmd =~ /^info\s+(.+)$/) {
|
||||||
|
my @otherusers = split ' ', $1;
|
||||||
|
&parse_acl($GL_CONF_COMPILED);
|
||||||
|
die "you can't ask for others' permissions\n" unless $repos{'gitolite-admin'}{'R'}{$user};
|
||||||
|
for my $otheruser (@otherusers) {
|
||||||
|
warn("ignoring illegal username $otheruser\n"), next unless $otheruser =~ $USERNAME_PATT;
|
||||||
|
&report_basic($GL_ADMINDIR, $GL_CONF_COMPILED, $otheruser);
|
||||||
|
}
|
||||||
} elsif ($HTPASSWD_FILE and $cmd eq 'htpasswd') {
|
} elsif ($HTPASSWD_FILE and $cmd eq 'htpasswd') {
|
||||||
&ext_cmd_htpasswd($HTPASSWD_FILE);
|
&ext_cmd_htpasswd($HTPASSWD_FILE);
|
||||||
} elsif ($RSYNC_BASE and $cmd =~ /^rsync /) {
|
} elsif ($RSYNC_BASE and $cmd =~ /^rsync /) {
|
||||||
|
|
Loading…
Reference in a new issue