1 # @tag: webshop_api_rights
 
   2 # @description: Setzt die Rechte Shopconfig, Shopbestellungen, Shopartikel, per Default erlaubt
 
   3 # @depends: release_3_5_0
 
   4 # @locales: Create and edit shopparts
 
   5 # @locales: Get shoporders
 
   6 # @locales: Create and edit webshops
 
   7 package SL::DBUpgrade2::Auth::webshop_api_rights;
 
  12 use parent qw(SL::DBUpgrade2::Base);
 
  19   $self->db_query("INSERT INTO auth.master_rights (position, name, description) VALUES ( 550,  'shop_part_edit',   'Create and edit shopparts')");
 
  20   $self->db_query("INSERT INTO auth.master_rights (position, name, description) VALUES ( 950,  'shop_order',       'Get shoporders')");
 
  21   $self->db_query("INSERT INTO auth.master_rights (position, name, description) VALUES ( 4300, 'edit_shop_config', 'Create and edit webshops')");
 
  23   my $groups = $main::auth->read_groups();
 
  25   foreach my $group (values %{$groups}) {
 
  26     $group->{rights}->{shop_part_edit}   = 1;
 
  27     $group->{rights}->{shop_order}       = 1;
 
  28     $group->{rights}->{edit_shop_config} = 1;
 
  29     $main::auth->save_group($group);