From a4f34d9851c3c7bec20dc2faeaaa13ad13fd254f Mon Sep 17 00:00:00 2001 From: Andreas Maierhofer Date: Wed, 8 Jan 2025 14:36:39 +0100 Subject: [PATCH] Show external invoices tab for root user --- app/helpers/sac_cas/sheet/person.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/helpers/sac_cas/sheet/person.rb b/app/helpers/sac_cas/sheet/person.rb index 3372219ad..2c81c7032 100644 --- a/app/helpers/sac_cas/sheet/person.rb +++ b/app/helpers/sac_cas/sheet/person.rb @@ -20,9 +20,8 @@ module SacCas::Sheet::Person "people.tabs.external_invoices", :external_invoices_group_person_path, if: ->(view, group, person) do - return false unless person.roles.map(&:group_id).include?(group.id) - - view.can?(:index_external_invoices, person) + view.can?(:index_external_invoices, person) && + (person.roles.map(&:group_id).include?(group.id) || person.root?) end ))