/[transports]/trunk/lib/Transports/Model/User.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Transports/Model/User.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 32 by dpavlin, Sat May 27 10:07:39 2006 UTC revision 46 by dpavlin, Tue May 30 18:09:51 2006 UTC
# Line 33  column admin => Line 33  column admin =>
33          default is 'false',          default is 'false',
34          since '0.0.8';          since '0.0.8';
35    
36    column can_import =>
37            type is 'boolean',
38            label is 'Import request',
39            is mandatory,
40            default is 'false',
41            since '0.0.12';
42    
43  column sources =>  column sources =>
44          refers_to Transports::Model::UserOnSourceCollection by 'user_on',          refers_to Transports::Model::UserOnSourceCollection by 'user_on',
45          label is 'Source systems',          label is 'Source systems',
# Line 91  sub current_user_can { Line 98  sub current_user_can {
98      #Carp::confess if ($right eq 'read' and not $args{'column'});      #Carp::confess if ($right eq 'read' and not $args{'column'});
99    
100      if ( $right eq 'read'      if ( $right eq 'read'
101          and ( $self->id == $self->current_user->id or $self->current_user->admin ) )          and ( $self->id == $self->current_user->id or $self->current_user->admin or $self->current_user->can_import ) )
102      {      {
103          return 1;          return 1;
104      } elsif ( $right eq 'read' and $args{'column'} eq 'name' ) {      } elsif ( $right eq 'read' and $args{'column'} eq 'name' ) {
105          return (1);          return (1);
106    
107      } elsif ( $right eq 'update'      } elsif (
108          and $self->id == $self->current_user->id                  $right eq 'update' and
109          and $args{'column'} ne 'email_confirmed' )                  ( $self->id == $self->current_user->id or $self->current_user->admin )
110      {          ) {
111          return (1);          return (1);
112      }      }
113    

Legend:
Removed from v.32  
changed lines
  Added in v.46

  ViewVC Help
Powered by ViewVC 1.1.26