Parent Directory | Revision Log
added landscapes (collection of source and destination clients) to the mix instead of specifing users for sources (and destinations which wasn't implemented anyway)
1 | use strict; |
2 | use warnings; |
3 | |
4 | package Transports::Model::Landscape::Schema; |
5 | use Jifty::DBI::Schema; |
6 | |
7 | # Your column definitions go here. See L<Jifty::DBI::Schema> for |
8 | # documentation about how to write column definitions. |
9 | |
10 | column name => |
11 | type is 'text', |
12 | label is 'Landscape', |
13 | is mandatory, |
14 | is distinct; |
15 | |
16 | package Transports::Model::Landscape; |
17 | use base qw/Transports::Record/; |
18 | |
19 | # Your model-specific methods go here. |
20 | |
21 | =head2 current_user_can |
22 | |
23 | everybody can read landscapes while only admins can update it |
24 | |
25 | =cut |
26 | |
27 | sub current_user_can { |
28 | my $self = shift; |
29 | my $right = shift; |
30 | my %args = (@_); |
31 | |
32 | return 1 if ($right eq 'read' or $self->current_user->admin ); |
33 | |
34 | return $self->SUPER::current_user_can( $right, %args ); |
35 | } |
36 | |
37 | 1; |
38 |
ViewVC Help | |
Powered by ViewVC 1.1.26 |