separating "push" from "create"

This is what I *should* have done back then; thanks to Jeff Mitchell for
pointing out a problem with the old method.

The old one is *definitely* a kludge.  <shamefaced grin>
This commit is contained in:
Sitaram Chamarty 2010-06-18 20:14:40 +05:30
parent 78c8caa24c
commit a430cc57c7
6 changed files with 126 additions and 44 deletions

View file

@ -291,6 +291,7 @@ sub parse_acl
for my $r ('@all', @repo_plus) {
my $dr = $repo; $dr = '@all' if $r eq '@all';
$repos{$dr}{DELETE_IS_D} = 1 if $repos{$r}{DELETE_IS_D};
$repos{$dr}{CREATE_IS_C} = 1 if $repos{$r}{CREATE_IS_C};
$repos{$dr}{NAME_LIMITS} = 1 if $repos{$r}{NAME_LIMITS};
for my $u ('@all', "$gl_user - wild", @user_plus) {

View file

@ -204,7 +204,7 @@ sub parse_conf_file
s/\bCREAT[EO]R\b/\$creator/g for @repos;
}
# actual permission line
elsif (/^(-|C|R|RW\+?D?) (.* )?= (.+)/)
elsif (/^(-|C|R|RW\+?(?:C?D?|D?C?)) (.* )?= (.+)/)
{
my $perms = $1;
my @refs; @refs = split(' ', $2) if $2;
@ -286,6 +286,7 @@ sub parse_conf_file
# that fact easy to find; this changes the meaning of RW+
# to no longer permit deletes (see update hook)
$repos{$repo}{DELETE_IS_D} = 1 if $perms =~ /D/;
$repos{$repo}{CREATE_IS_C} = 1 if $perms =~ /RW.*C/;
# for 2nd level check, store each "ref, perms" pair in order
for my $ref (@refs)