Changeset 385

Show
Ignore:
Timestamp:
11/15/07 03:51:36 (2 years ago)
Author:
latiass
Message:

Removed user-specific permissions, as they are useless and add about 50 queries. Worst case scenario, we make a group with one user.

Location:
veekun/trunk/lib/Vee
Files:
1 removed
1 modified

Legend:

Unmodified
Added
Removed
  • veekun/trunk/lib/Vee/Authorization.pm

    r292 r385  
    4747        columns => [ 'polarity' ], 
    4848    }); 
    49          
    50     my @userperms = $c->model('UserPermissions')->search({ 
    51             userid => [ $c->user->obj->id, 0 ], 
    52         permission => [ $permission, 'splat' ], 
    53         scope => $scope, 
    54     }, { 
    55         order_by => \'scope = "" DESC, permission = "splat" DESC', 
    56         group_by => [ 'scope', 'permission' ], 
    57         columns => [ 'polarity' ], 
    58     }); 
    59          
    60         # User permissions take precedence over group permissions 
    61         if (grep { $_->polarity eq 'deny' } @userperms) { 
    62             return 0 
    63         } elsif (grep { $_->polarity eq 'allow' } @userperms) { 
    64             return 1 
    65         } 
    66          
    6749    if (!@groupperms) { 
    6850        return undef