From c9a8a4fef371d81779934155c1978e2629506c86 Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Wed, 10 Jul 2024 19:17:06 +0200 Subject: [PATCH] Added permission for Invoice --- Layout/default/menu.php | 1 + application/Invoice/InvoiceController.php | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Layout/default/menu.php b/Layout/default/menu.php index b6f285ee8..73875f175 100644 --- a/Layout/default/menu.php +++ b/Layout/default/menu.php @@ -93,6 +93,7 @@
  • "> Contracts
  • "> Erweiterte Suche
  • is(["Admin"]) && $me->can("Billing")): ?>
  • "> Verrechnung
  • + is(["Admin"]) && $me->can("Billing")): ?>
  • "> Rechnungen
  • diff --git a/application/Invoice/InvoiceController.php b/application/Invoice/InvoiceController.php index 032439849..466c8a0bb 100644 --- a/application/Invoice/InvoiceController.php +++ b/application/Invoice/InvoiceController.php @@ -15,7 +15,7 @@ class InvoiceController extends mfBaseController { } protected function indexAction() { - if(!$this->me->is("Billing")) { + if(!$this->me->can("Billing")) { $this->redirect("Dashboard"); } $this->layout()->setTemplate("Invoice/Index"); @@ -182,7 +182,7 @@ class InvoiceController extends mfBaseController { protected function runInvoicingAction() { - if(!$this->me->is("Billing")) { + if(!$this->me->can("Billing")) { $this->redirect("Dashboard"); } @@ -573,7 +573,7 @@ class InvoiceController extends mfBaseController { } protected function exportBmdAction() { - if(!$this->me->is("Billing")) { + if(!$this->me->can("Billing")) { $this->redirect("Dashboard"); } /* @@ -707,7 +707,7 @@ class InvoiceController extends mfBaseController { } protected function sendInvoicesAction() { - if(!$this->me->is("Billing")) { + if(!$this->me->can("Billing")) { $this->redirect("Dashboard"); } @@ -767,7 +767,7 @@ class InvoiceController extends mfBaseController { } public function printInvoices() { - if(!$this->me->is("Billing")) { + if(!$this->me->can("Billing")) { $this->redirect("Dashboard"); }