Changeset 480


Ignore:
Timestamp:
10/04/09 05:01:59 (15 years ago)
Author:
nanardon
Message:
  • revert previous commit
Location:
LATMOS-Accounts
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • LATMOS-Accounts/MANIFEST

    r479 r480  
    77annexes/sql.schema.sql 
    88bin/la-acls 
    9 bin/la-attributes 
    109bin/la-config 
    1110bin/la-create 
  • LATMOS-Accounts/lib/LATMOS/Accounts/Acls.pm

    r479 r480  
    3333enclose into bracket, either a '*' to match any attribute. 
    3434 
    35 Special keyword C<@CREATE> and C<@DELETE> can be used to allow or deny object 
     35Special keyword C<CREATE> and C<DELETE> can be used to allow or deny object 
    3636creation and deletion. In this case USER in form C<$...> and read permission 
    37 have no effect (see below). C<*> do not include C<@CREATE> and C<@DELETE> action. 
     37have no effect (see below). C<*> do not include C<CREATE> and C<DELETE> action. 
    3838 
    3939=item USER can be 
     
    127127sub check { 
    128128    my ($self, $obj, $attr, $perm, $who, $groups) = @_; 
    129     # Asking 'r' perm over create or delete has no sense: 
    130     $attr =~ /^@(CREATE|DELETE)$/ && $perm eq 'r' and return; 
    131  
    132129    foreach my $acl (@{$self->{_acls}}) { 
    133130        my $res = $acl->match($obj, $attr, $perm, $who, $groups); 
     
    191188    my $objtype = ref $obj ? lc($obj->type) : $obj; 
    192189    $attr = lc($attr); 
    193  
    194     # Does this ACL series concern this object: 
    195190    if (!($self->{obj} eq '*' || $self->{obj} eq $objtype)) { 
    196191        return 
    197192    } 
    198     # Does this ACL series concern this attribute: 
    199     grep { ($_ !~ /^@(CREATE|DELETE)$/ && $_ eq '*') || $_ eq $attr } @{$self->{attr}} or return; 
    200  
    201     # Foreach user, testing if this permission match: 
     193    grep { ($_ !~ /^(CREATE|DELETE)$/ && $_ eq '*') || $_ eq $attr } @{$self->{attr}} or return; 
     194 
    202195    foreach my $u (@{ $self->{users} }) { 
    203         # Obj have attr eq login user 
    204196        if (substr($u->{user}, 0, 1) eq '$') { # check attr content 
    205197            if (ref $obj) { 
     
    209201                return ($u->{$perm} || 0) if (grep { $_ eq $who } @vals); 
    210202            } 
    211         # user is in group 
    212203        } elsif (substr($u->{user}, 0, 1) eq '%') { # group 
    213204            my $group = substr($u->{user}, 1); 
    214205            return ($u->{$perm} || 0) if (grep { $group eq $_ } @{$groups ||[]}); 
    215         # any user 
    216206        } elsif ($u->{user} eq '*' || $u->{user} eq $who) { 
    217207            return $u->{$perm} || 0; 
    218         # any authenticated user 
    219208        } elsif (lc($u->{user}) eq '@authenticated' && $who) { 
    220209            return $u->{$perm} || 0; 
    221         # not login 
    222210        } elsif (lc($u->{user}) eq '@anonymous' && $who eq "") { 
    223211            return $u->{$perm} || 0; 
Note: See TracChangeset for help on using the changeset viewer.