--- trunk/lib/Transports/Model/Source.pm 2006/06/05 15:09:51 57 +++ trunk/lib/Transports/Model/Source.pm 2006/06/05 15:21:18 58 @@ -27,7 +27,7 @@ =head2 current_user_can ACTION -Everybody can read, admin and import can everything else. +admin and import can everything, users with permission on landscape can read. =cut @@ -35,7 +35,22 @@ my $self = shift; my $type = shift; - return 1 if ($type eq 'read' || $self->current_user->admin || $self->current_user->can_import); + return 1 if ($self->current_user->admin || $self->current_user->can_import); + + if ($type eq 'read') { + + my $l = Transports::Model::UserOnLandscape->new(); + $l->load_by_cols( + user_on => $self->current_user->id, + landscape => $self->landscape->id, + ); + + if ($l->id) { + return 1; + } else { + return undef; + } + } return $self->SUPER::current_user_can($type, @_); }