(big-config) allow usergroup information to be passed in from outside

[Please NOTE: this is all about *user* groups, not *repo* groups]

SUMMARY: gl-auth-commmand can now take an optional list of usergroup
names after the first argument (which is the username).

See doc/big-config.mkd in the next commit or so
This commit is contained in:
Sitaram Chamarty 2010-05-14 16:35:37 +05:30
parent d11a27924b
commit 8da223f92a
2 changed files with 11 additions and 1 deletions

View file

@ -530,7 +530,13 @@ sub get_memberships {
}
# deal with returning user info first
return (@ret) unless $is_repo;
unless ($is_repo) {
# add in group membership info sent in via second and subsequent
# arguments to gl-auth-command; be sure to prefix the "@" sign to each
# of them!
push @ret, map { s/^/@/; $_; } split(' ', $ENV{GL_GROUP_LIST}) if $ENV{GL_GROUP_LIST};
return (@ret);
}
# enforce the rule about ignoring all wildcard matches if a non-wild match
# exists while returning. (The @ret gating above does not adequately

View file

@ -71,6 +71,10 @@ if ($ARGV[0] eq '-s') {
# first, fix the biggest gripe I have with gitosis, a 1-line change
my $user=$ENV{GL_USER}=shift; # there; now that's available everywhere!
# if there are any more arguments, they're a list of group names that the user
# is a member of
$ENV{GL_GROUP_LIST} = join(" ", @ARGV) if @ARGV;
# ----------------------------------------------------------------------------
# logging, timestamp env vars
# ----------------------------------------------------------------------------