Bugfix: Brieffunktion prüft im Einkauf auf Verkaufsbriefrechte
authorJan Büren <jan@kivitendo.de>
Fri, 5 Jul 2019 12:24:00 +0000 (14:24 +0200)
committerJan Büren <jan@kivitendo.de>
Fri, 5 Jul 2019 12:24:00 +0000 (14:24 +0200)
Ternärer Operator für Fallunterscheidung
(is_sales or is_not_very_much_sales)

SL/Controller/Letter.pm

index 36f9275..beb1a46 100644 (file)
@@ -592,11 +592,13 @@ sub init_is_sales {
 }
 
 sub check_auth_edit {
-  $::auth->assert('sales_letter_edit');
+  $::form->{is_sales} ? $::auth->assert('sales_letter_edit')
+                      : $::auth->assert('purchase_letter_edit');
 }
 
 sub check_auth_report {
-  $::auth->assert('sales_letter_report');
+  $::form->{is_sales} ? $::auth->assert('sales_letter_report')
+                      : $::auth->assert('purchase_letter_report');
 }
 
 sub setup_load_letter_draft_action_bar {