4 |
package Arh::Model::Unit; |
package Arh::Model::Unit; |
5 |
use Jifty::DBI::Schema; |
use Jifty::DBI::Schema; |
6 |
|
|
7 |
|
use Data::Dump qw/dump/; |
8 |
|
|
9 |
use Arh::Record schema { |
use Arh::Record schema { |
10 |
|
|
11 |
column name => |
column name => |
19 |
is mandatory; |
is mandatory; |
20 |
|
|
21 |
column campaign => |
column campaign => |
22 |
|
label is _("Part of campaign"), |
23 |
refers_to Arh::Model::Campaign, |
refers_to Arh::Model::Campaign, |
24 |
is mandatory, |
is mandatory, |
25 |
since '0.0.9'; |
since '0.0.9'; |
48 |
|
|
49 |
}; |
}; |
50 |
|
|
51 |
|
#use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata; # created_by, created_on, updated_on |
52 |
|
|
53 |
# Your model-specific methods go here. |
# Your model-specific methods go here. |
54 |
|
|
55 |
sub material { |
sub material { |
59 |
return $m; |
return $m; |
60 |
} |
} |
61 |
|
|
62 |
|
sub current_user_can { |
63 |
|
my ( $self, $action,$item,$value ) = @_; |
64 |
|
warn "## |$action|$item|$value| user id: ",$self->current_user->id; |
65 |
|
return 1 if $self->current_user->superuser; |
66 |
|
return 1 if $self->current_user->administrator; |
67 |
|
return 1 if $action eq 'read'; |
68 |
|
return 0; |
69 |
|
} |
70 |
|
|
71 |
1; |
1; |
72 |
|
|