1 # @tag: mail_journal_rights
 
   2 # @description:  Extra right for email journal
 
   3 # @depends: master_rights_position_gaps
 
   4 # @locales: E-Mail-Journal
 
   5 # @locales: Read all employee e-mails
 
   7 package SL::DBUpgrade2::Auth::mail_journal_rights;
 
  12 use parent qw(SL::DBUpgrade2::Base);
 
  19   $self->db_query("INSERT INTO auth.master_rights (position, name, description) VALUES (?, ?, ?)", bind => $_) for
 
  20     [ 4450, 'email_journal'         , 'E-Mail-Journal'            ],
 
  21     [ 4480, 'email_employee_readall', 'Read all employee e-mails' ];
 
  23   my $groups = $main::auth->read_groups();
 
  25   foreach my $group (values %{$groups}) {
 
  26     $group->{rights}->{email_journal}          = $group->{rights}->{productivity};
 
  27     $group->{rights}->{email_employee_readall} = $group->{rights}->{admin};
 
  28     $main::auth->save_group($group);