Revision 2b572ee0
Von Werner Hahn vor mehr als 7 Jahren hinzugefügt
sql/Pg-upgrade2-auth/webshop_api_rights.pl | ||
---|---|---|
1 |
# @tag: webshop_api_rights |
|
2 |
# @description: Setzt die Rechte Shopconfig, Shopbestellungen, Shopartikel, per Default erlaubt |
|
3 |
# @depends: release_3_5_0 |
|
4 |
package SL::DBUpgrade2::Auth::webshop_api_rights; |
|
5 |
|
|
6 |
use strict; |
|
7 |
use utf8; |
|
8 |
|
|
9 |
use parent qw(SL::DBUpgrade2::Base); |
|
10 |
|
|
11 |
use SL::DBUtils; |
|
12 |
|
|
13 |
sub run { |
|
14 |
my ($self) = @_; |
|
15 |
|
|
16 |
$self->db_query("INSERT INTO auth.master_rights (position, name, description) VALUES ( 550, 'shop_part_edit', 'Create and edit shopparts')"); |
|
17 |
$self->db_query("INSERT INTO auth.master_rights (position, name, description) VALUES ( 950, 'shop_order', 'Get shoporders')"); |
|
18 |
$self->db_query("INSERT INTO auth.master_rights (position, name, description) VALUES ( 4300, 'edit_shop_config', 'Create and edit webshops')"); |
|
19 |
|
|
20 |
my $groups = $main::auth->read_groups(); |
|
21 |
|
|
22 |
foreach my $group (values %{$groups}) { |
|
23 |
$group->{rights}->{shop_part_edit} = 1; |
|
24 |
$group->{rights}->{shop_order} = 1; |
|
25 |
$group->{rights}->{edit_shop_config} = 1; |
|
26 |
$main::auth->save_group($group); |
|
27 |
} |
|
28 |
|
|
29 |
return 1; |
|
30 |
} # end run |
|
31 |
|
|
32 |
1; |
Auch abrufbar als: Unified diff
WebshopApi: neues Recht webshop_api_rights