From: Werner Hahn Date: Fri, 22 Sep 2017 00:34:49 +0000 (+0200) Subject: WebshopApi: neues Recht webshop_api_rights X-Git-Tag: release-3.5.4~793 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=2b572ee00e7e4380eca135153473f4d9f7f1955a;p=kivitendo-erp.git WebshopApi: neues Recht webshop_api_rights --- 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..6c0190520 --- /dev/null +++ b/sql/Pg-upgrade2-auth/webshop_api_rights.pl @@ -0,0 +1,32 @@ +# @tag: webshop_api_rights +# @description: Setzt die Rechte Shopconfig, Shopbestellungen, Shopartikel, per Default erlaubt +# @depends: release_3_5_0 +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;