/[transports]/trunk/lib/Transports/Model/Landscape.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/Landscape.pm

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

revision 79 by dpavlin, Mon Jun 5 15:05:58 2006 UTC revision 80 by dpavlin, Tue Jun 13 22:43:47 2006 UTC
# Line 40  sub current_user_can { Line 40  sub current_user_can {
40      my $right = shift;      my $right = shift;
41      my %args  = (@_);      my %args  = (@_);
42    
43          return 1 if ($right eq 'read' or $self->current_user->admin );          return 1 if ($self->current_user->admin || $self->current_user->can_import);
44    
45            if ($right eq 'read') {
46                    my $l = Transports::Model::UserOnLandscape->new();
47                    $l->load_by_cols(
48                            user_on => $self->current_user->id,
49                            landscape => $self->id,
50                    );
51    
52                    if ($l->id) {
53                            return 1;
54                    } else {
55                            return undef;
56                    }
57            }
58    
59      return $self->SUPER::current_user_can( $right, %args );      return $self->SUPER::current_user_can( $right, %args );
60  }  }

Legend:
Removed from v.79  
changed lines
  Added in v.80

  ViewVC Help
Powered by ViewVC 1.1.26