line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Interchange6::Schema::Populate::Role; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Interchange6::Schema::Populate::Role |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 DESCRIPTION |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
This module provides population capabilities for the Role result class |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=cut |
12
|
|
|
|
|
|
|
|
13
|
4
|
|
|
4
|
|
2178
|
use Moo::Role; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
50
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 METHODS |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head2 populate_roles |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=over |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=item * admin |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
Shop administrator with full permissions. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=item * user |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
All non-anonymous users have this role. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=item * anonymous |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Anonymous users. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=back |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=cut |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub populate_roles { |
38
|
4
|
|
|
4
|
1
|
217
|
my $self = shift; |
39
|
4
|
|
|
|
|
27
|
my $rset = $self->schema->resultset('Role'); |
40
|
4
|
|
|
|
|
1490
|
$rset->create( |
41
|
|
|
|
|
|
|
{ |
42
|
|
|
|
|
|
|
name => "admin", |
43
|
|
|
|
|
|
|
label => "Admin", |
44
|
|
|
|
|
|
|
description => "Shop administrator with full permissions", |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
); |
47
|
4
|
|
|
|
|
9055
|
$rset->create( |
48
|
|
|
|
|
|
|
{ |
49
|
|
|
|
|
|
|
name => "user", |
50
|
|
|
|
|
|
|
label => "User", |
51
|
|
|
|
|
|
|
description => "All users have this role", |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
); |
54
|
4
|
|
|
|
|
8164
|
$rset->create( |
55
|
|
|
|
|
|
|
{ |
56
|
|
|
|
|
|
|
name => "anonymous", |
57
|
|
|
|
|
|
|
label => "Anonymous", |
58
|
|
|
|
|
|
|
description => "Anonymous users", |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |