From a809d8acb37498336cf273bece47f66fdfd49bdd Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 9 Jan 2026 16:48:17 +0100 Subject: [PATCH] Bug 39142: Remove Koha::Template::Plugin::debug_flag Signed-off-by: Lucas Gass --- Koha/Template/Plugin/Koha.pm | 20 ------------------- .../intranet-tmpl/prog/en/includes/header.inc | 2 +- .../prog/en/includes/intranet-bottom.inc | 2 +- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/Koha/Template/Plugin/Koha.pm b/Koha/Template/Plugin/Koha.pm index 992b1974ecc..11ed0cecf37 100644 --- a/Koha/Template/Plugin/Koha.pm +++ b/Koha/Template/Plugin/Koha.pm @@ -87,26 +87,6 @@ sub MultivaluePreference { return C4::Context->multivalue_preference($pref); } -=head3 debug_flag - -This method checks if the currently logged in user is allowed -access to the new debug ui permission. It should return -0 if no one is logged in or context is unavailable for some other reason - or they do not have the permission -1 if they are a superlibrarian -1<<32 if they do have the permission - -=cut - -sub debug_flag { - return 0 unless C4::Context->userenv(); - return 1 if C4::Context->IsSuperLibrarian(); - my $flags = C4::Context->userenv()->{'flags'}; - my $mask = 1 << 32; - return $flags & $mask; - -} - =head3 CSVDelimiter The delimiter option 'tabs' is stored in the DB as 'tabulation' to avoid issues diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc index 5b00a098c0d..089e8d6c05a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc @@ -248,7 +248,7 @@ - [% IF Koha.debug_flag %] + [% IF logged_in_user.has_permission({debug => 1}) %]