X-Git-Url: http://wagnertech.de/git?p=kivitendo-erp.git;a=blobdiff_plain;f=sql%2FPg-upgrade2-auth%2Fwebshop_api_rights.pl;fp=sql%2FPg-upgrade2-auth%2Fwebshop_api_rights.pl;h=b62b3fe228313523bb87c724a4dd31bc2e5e8912;hp=0000000000000000000000000000000000000000;hb=53593baa211863fbf66540cf1bcc36c8fb37257f;hpb=deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44 diff --git a/sql/Pg-upgrade2-auth/webshop_api_rights.pl b/sql/Pg-upgrade2-auth/webshop_api_rights.pl new file mode 100644 index 000000000..b62b3fe22 --- /dev/null +++ b/sql/Pg-upgrade2-auth/webshop_api_rights.pl @@ -0,0 +1,35 @@ +# @tag: webshop_api_rights +# @description: Setzt die Rechte Shopconfig, Shopbestellungen, Shopartikel, per Default erlaubt +# @depends: release_3_5_0 +# @locales: Create and edit shopparts +# @locales: Get shoporders +# @locales: Create and edit webshops +package SL::DBUpgrade2::Auth::webshop_api_rights; + +use strict; +use utf8; + +use parent qw(SL::DBUpgrade2::Base); + +use SL::DBUtils; + +sub run { + my ($self) = @_; + + $self->db_query("INSERT INTO auth.master_rights (position, name, description) VALUES ( 550, 'shop_part_edit', 'Create and edit shopparts')"); + $self->db_query("INSERT INTO auth.master_rights (position, name, description) VALUES ( 950, 'shop_order', 'Get shoporders')"); + $self->db_query("INSERT INTO auth.master_rights (position, name, description) VALUES ( 4300, 'edit_shop_config', 'Create and edit webshops')"); + + my $groups = $main::auth->read_groups(); + + foreach my $group (values %{$groups}) { + $group->{rights}->{shop_part_edit} = 1; + $group->{rights}->{shop_order} = 1; + $group->{rights}->{edit_shop_config} = 1; + $main::auth->save_group($group); + } + + return 1; +} # end run + +1;