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