(rrq) refactor all the rights querying
This commit series refactors all the rights querying logic. - old repo_rights sub renamed to wild_repo_rights - new repo_rights sub to be a single entry point for most rights queries - callable from gl-auth-command and expand_wild - callable from *outside* too, as long as $ENV{GL_USER} is set - the format of the returned permissions contains C, R, and W as applicable, with sigils reflecting the 3 possible ways in which you can get R or W perms (2 ways for C): @R means @all users have the same access #R means you're a "super user" (think root's shell prompt) so you can see all repos R is the normal, explicit, access
This commit is contained in:
parent
820d3f5948
commit
90e141cd61
2 changed files with 67 additions and 7 deletions
|
@ -49,7 +49,7 @@ $ENV{PATH} .= ":$GIT_PATH" if $GIT_PATH;
|
|||
# set the umask before creating any files
|
||||
umask($REPO_UMASK);
|
||||
|
||||
my $repo_base_abs = ( $REPO_BASE =~ m(^/) ? $REPO_BASE : "$ENV{HOME}/$REPO_BASE" );
|
||||
my $repo_base_abs = $ENV{GL_REPO_BASE_ABS} = ( $REPO_BASE =~ m(^/) ? $REPO_BASE : "$ENV{HOME}/$REPO_BASE" );
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# start...
|
||||
|
@ -170,7 +170,7 @@ $ENV{GL_REPO}=$repo;
|
|||
|
||||
if ( -d "$repo_base_abs/$repo.git" ) {
|
||||
# existing repo
|
||||
my ($creater, $user_R, $user_W) = &repo_rights($repo_base_abs, $repo, $user);
|
||||
my ($creater, $user_R, $user_W) = &wild_repo_rights($repo_base_abs, $repo, $user);
|
||||
&parse_acl($GL_CONF_COMPILED, $repo, $creater, $user_R, $user_W);
|
||||
} else {
|
||||
&parse_acl($GL_CONF_COMPILED, $repo, $user, "NOBODY", "NOBODY");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue