line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Elive::Entity::Role; |
2
|
8
|
|
|
8
|
|
1010
|
use warnings; use strict; |
|
8
|
|
|
8
|
|
9
|
|
|
8
|
|
|
|
|
236
|
|
|
8
|
|
|
|
|
39
|
|
|
8
|
|
|
|
|
9
|
|
|
8
|
|
|
|
|
215
|
|
3
|
|
|
|
|
|
|
|
4
|
8
|
|
|
8
|
|
34
|
use Mouse; |
|
8
|
|
|
|
|
9
|
|
|
8
|
|
|
|
|
36
|
|
5
|
8
|
|
|
8
|
|
2059
|
use Mouse::Util::TypeConstraints; |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
43
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
extends 'Elive::Entity'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Elive::Entity::Role - Elluminate Role entity class |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 DESCRIPTION |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
This is a structural class for Elive roles. It is a component of the |
16
|
|
|
|
|
|
|
L and L |
17
|
|
|
|
|
|
|
entities. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
__PACKAGE__->entity_name('Role'); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
has 'roleId' => (is => 'rw', isa => 'Int', required => 1); |
24
|
|
|
|
|
|
|
__PACKAGE__->primary_key('roleId'); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
our ( $SYSTEM_ADMIN, $APPLICATION_ADMIN, $MODERATOR, $PARTICIPANT ); |
27
|
|
|
|
|
|
|
BEGIN { |
28
|
8
|
|
|
8
|
|
1261
|
$SYSTEM_ADMIN = 0; |
29
|
8
|
|
|
|
|
12
|
$APPLICATION_ADMIN = 1; |
30
|
8
|
|
|
|
|
19
|
$MODERATOR = 2; |
31
|
8
|
|
|
|
|
848
|
$PARTICIPANT = 3; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub BUILDARGS { |
35
|
106
|
|
|
106
|
1
|
190
|
my $class = shift; |
36
|
106
|
|
|
|
|
90
|
my $spec = shift; |
37
|
|
|
|
|
|
|
|
38
|
106
|
|
|
|
|
81
|
my $args; |
39
|
106
|
100
|
66
|
|
|
369
|
if (defined $spec && ! ref $spec) { |
40
|
21
|
|
|
|
|
63
|
$args = {roleId => $spec}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
else { |
43
|
85
|
|
|
|
|
88
|
$args = $spec; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
106
|
|
|
|
|
632
|
return $args; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
coerce 'Elive::Entity::Role' => from 'HashRef|Int' |
50
|
|
|
|
|
|
|
=> via {Elive::Entity::Role->new($_) }; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |