1 |
use strict; |
2 |
use warnings; |
3 |
|
4 |
package Transports::Model::Destination::Schema; |
5 |
use Jifty::DBI::Schema; |
6 |
|
7 |
use Transports::Model::Landscape; |
8 |
|
9 |
column name => |
10 |
type is 'text', |
11 |
label is 'Destination client', |
12 |
is mandatory, |
13 |
since '0.0.7'; |
14 |
|
15 |
column landscape => |
16 |
refers_to Transports::Model::Landscape, |
17 |
label is 'Part of landscape', |
18 |
is mandatory, |
19 |
since '0.0.13'; |
20 |
|
21 |
# Your column definitions go here. See L<Jifty::DBI::Schema> for |
22 |
# documentation about how to write column definitions. |
23 |
|
24 |
package Transports::Model::Destination; |
25 |
use base qw/Transports::Record/; |
26 |
|
27 |
# Your model-specific methods go here. |
28 |
|
29 |
=head2 current_user_can ACTION |
30 |
|
31 |
Let everybody create, read and update, but not delete. |
32 |
|
33 |
=cut |
34 |
|
35 |
sub current_user_can { |
36 |
my $self = shift; |
37 |
my $type = shift; |
38 |
|
39 |
# We probably want something like this eventually: |
40 |
if ($type =~ /(?:create|read|update)/i) { |
41 |
return 1; |
42 |
} else { |
43 |
return $self->SUPER::current_user_can($type, @_); |
44 |
} |
45 |
} |
46 |
|
47 |
1; |
48 |
|