1 |
dpavlin |
4 |
use strict; |
2 |
|
|
use warnings; |
3 |
|
|
|
4 |
|
|
package Arh::Model::Place; |
5 |
|
|
use Jifty::DBI::Schema; |
6 |
|
|
|
7 |
|
|
use Arh::Record schema { |
8 |
|
|
|
9 |
|
|
column name => |
10 |
|
|
label is _("Name of place"), |
11 |
|
|
is mandatory; |
12 |
|
|
|
13 |
|
|
column note => |
14 |
|
|
label is _("Note"); |
15 |
|
|
|
16 |
|
|
}; |
17 |
|
|
|
18 |
dpavlin |
10 |
#use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata; # created_by, created_on, updated_on |
19 |
|
|
|
20 |
dpavlin |
4 |
# Your model-specific methods go here. |
21 |
|
|
|
22 |
|
|
sub since { '0.0.3' } |
23 |
|
|
|
24 |
dpavlin |
10 |
sub current_user_can { |
25 |
|
|
my ( $self, $action,$item,$name ) = @_; |
26 |
|
|
return 1 if $self->current_user->superuser || $self->current_user->administrator; |
27 |
|
|
return 1 if $self->current_user->id && $action eq 'read'; |
28 |
|
|
return 0; |
29 |
|
|
} |
30 |
|
|
|
31 |
dpavlin |
4 |
1; |
32 |
|
|
|