From 8ac46dbccfa308b7abdcb1d8e5698eaba0cd3ff8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Fri, 5 Jul 2019 14:24:00 +0200 Subject: [PATCH] =?utf8?q?Bugfix:=20Brieffunktion=20pr=C3=BCft=20im=20Eink?= =?utf8?q?auf=20auf=20Verkaufsbriefrechte?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Ternärer Operator für Fallunterscheidung (is_sales or is_not_very_much_sales) --- SL/Controller/Letter.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SL/Controller/Letter.pm b/SL/Controller/Letter.pm index 36f927573..beb1a46fc 100644 --- a/SL/Controller/Letter.pm +++ b/SL/Controller/Letter.pm @@ -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 { -- 2.20.1