Lines 23-34
__PACKAGE__->table("permissions");
Link Here
|
23 |
|
23 |
|
24 |
=head1 ACCESSORS |
24 |
=head1 ACCESSORS |
25 |
|
25 |
|
26 |
=head2 module_bit |
26 |
=head2 parent |
27 |
|
27 |
|
28 |
data_type: 'integer' |
28 |
data_type: 'varchar' |
29 |
default_value: 0 |
|
|
30 |
is_foreign_key: 1 |
29 |
is_foreign_key: 1 |
31 |
is_nullable: 0 |
30 |
is_nullable: 1 |
|
|
31 |
size: 64 |
32 |
|
32 |
|
33 |
=head2 code |
33 |
=head2 code |
34 |
|
34 |
|
Lines 46-58
__PACKAGE__->table("permissions");
Link Here
|
46 |
=cut |
46 |
=cut |
47 |
|
47 |
|
48 |
__PACKAGE__->add_columns( |
48 |
__PACKAGE__->add_columns( |
49 |
"module_bit", |
49 |
"parent", |
50 |
{ |
50 |
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 64 }, |
51 |
data_type => "integer", |
|
|
52 |
default_value => 0, |
53 |
is_foreign_key => 1, |
54 |
is_nullable => 0, |
55 |
}, |
56 |
"code", |
51 |
"code", |
57 |
{ data_type => "varchar", default_value => "", is_nullable => 0, size => 64 }, |
52 |
{ data_type => "varchar", default_value => "", is_nullable => 0, size => 64 }, |
58 |
"description", |
53 |
"description", |
Lines 63-93
__PACKAGE__->add_columns(
Link Here
|
63 |
|
58 |
|
64 |
=over 4 |
59 |
=over 4 |
65 |
|
60 |
|
66 |
=item * L</module_bit> |
|
|
67 |
|
68 |
=item * L</code> |
61 |
=item * L</code> |
69 |
|
62 |
|
70 |
=back |
63 |
=back |
71 |
|
64 |
|
72 |
=cut |
65 |
=cut |
73 |
|
66 |
|
74 |
__PACKAGE__->set_primary_key("module_bit", "code"); |
67 |
__PACKAGE__->set_primary_key("code"); |
75 |
|
68 |
|
76 |
=head1 RELATIONS |
69 |
=head1 RELATIONS |
77 |
|
70 |
|
78 |
=head2 module_bit |
71 |
=head2 parent |
79 |
|
72 |
|
80 |
Type: belongs_to |
73 |
Type: belongs_to |
81 |
|
74 |
|
82 |
Related object: L<Koha::Schema::Result::Userflag> |
75 |
Related object: L<Koha::Schema::Result::Permission> |
83 |
|
76 |
|
84 |
=cut |
77 |
=cut |
85 |
|
78 |
|
86 |
__PACKAGE__->belongs_to( |
79 |
__PACKAGE__->belongs_to( |
87 |
"module_bit", |
80 |
"parent", |
88 |
"Koha::Schema::Result::Userflag", |
81 |
"Koha::Schema::Result::Permission", |
89 |
{ bit => "module_bit" }, |
82 |
{ code => "parent" }, |
90 |
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, |
83 |
{ |
|
|
84 |
is_deferrable => 1, |
85 |
join_type => "LEFT", |
86 |
on_delete => "RESTRICT", |
87 |
on_update => "RESTRICT", |
88 |
}, |
89 |
); |
90 |
|
91 |
=head2 permissions |
92 |
|
93 |
Type: has_many |
94 |
|
95 |
Related object: L<Koha::Schema::Result::Permission> |
96 |
|
97 |
=cut |
98 |
|
99 |
__PACKAGE__->has_many( |
100 |
"permissions", |
101 |
"Koha::Schema::Result::Permission", |
102 |
{ "foreign.parent" => "self.code" }, |
103 |
{ cascade_copy => 0, cascade_delete => 0 }, |
91 |
); |
104 |
); |
92 |
|
105 |
|
93 |
=head2 user_permissions |
106 |
=head2 user_permissions |
Lines 101-116
Related object: L<Koha::Schema::Result::UserPermission>
Link Here
|
101 |
__PACKAGE__->has_many( |
114 |
__PACKAGE__->has_many( |
102 |
"user_permissions", |
115 |
"user_permissions", |
103 |
"Koha::Schema::Result::UserPermission", |
116 |
"Koha::Schema::Result::UserPermission", |
104 |
{ |
117 |
{ "foreign.code" => "self.code" }, |
105 |
"foreign.code" => "self.code", |
|
|
106 |
"foreign.module_bit" => "self.module_bit", |
107 |
}, |
108 |
{ cascade_copy => 0, cascade_delete => 0 }, |
118 |
{ cascade_copy => 0, cascade_delete => 0 }, |
109 |
); |
119 |
); |
110 |
|
120 |
|
111 |
|
121 |
|
112 |
# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 |
122 |
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-05-21 06:16:14 |
113 |
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ut3lzlxoPPoIIwmhJViV1Q |
123 |
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hazAo1EYPHLRItwCzwP1ww |
114 |
|
124 |
|
115 |
|
125 |
|
116 |
# You can replace this text with custom content, and it will be preserved on regeneration |
126 |
# You can replace this text with custom content, and it will be preserved on regeneration |