/[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

Annotation of /trunk/lib/Transports/Model/Landscape.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 56 - (hide annotations)
Mon Jun 5 15:05:58 2006 UTC (18 years ago) by dpavlin
File size: 1044 byte(s)
added landscapes list for admins
1 dpavlin 51 use strict;
2     use warnings;
3    
4     package Transports::Model::Landscape::Schema;
5     use Jifty::DBI::Schema;
6    
7 dpavlin 56 use Transports::Model::SourceCollection;
8     use Transports::Model::DestinationCollection;
9    
10 dpavlin 51 # Your column definitions go here. See L<Jifty::DBI::Schema> for
11     # documentation about how to write column definitions.
12    
13     column name =>
14     type is 'text',
15     label is 'Landscape',
16     is mandatory,
17     is distinct;
18    
19 dpavlin 56 column sources =>
20     refers_to Transports::Model::SourceCollection by 'landscape',
21     since '0.0.14';
22    
23     column destinations =>
24     refers_to Transports::Model::DestinationCollection by 'landscape',
25     since '0.0.14';
26    
27 dpavlin 51 package Transports::Model::Landscape;
28     use base qw/Transports::Record/;
29    
30     # Your model-specific methods go here.
31    
32     =head2 current_user_can
33    
34     everybody can read landscapes while only admins can update it
35    
36     =cut
37    
38     sub current_user_can {
39     my $self = shift;
40     my $right = shift;
41     my %args = (@_);
42    
43     return 1 if ($right eq 'read' or $self->current_user->admin );
44    
45     return $self->SUPER::current_user_can( $right, %args );
46     }
47    
48     1;
49    

  ViewVC Help
Powered by ViewVC 1.1.26