From dd09e402b6d5ba42fb33f29453c1441746a1afc8 Mon Sep 17 00:00:00 2001 From: Imani Thomas Date: Fri, 14 Feb 2025 21:03:23 +0000 Subject: [PATCH] Bug 39142: Add debug permission This patch adds the database foundation for the debug permission feature: - Creates bit 31 in userflags table for 'debug' permission - Updates mandatory userflags.sql for fresh installations - Provides atomic update script for existing installations The debug permission will allow authorized users to access debugging tools for toggling JavaScript and CSS customizations. Signed-off-by: Lari Strand Signed-off-by: Martin Renvoize --- .../data/mysql/atomicupdate/Bug_39142.pl | 20 +++++++++++++++++++ installer/data/mysql/mandatory/userflags.sql | 1 + 2 files changed, 21 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/Bug_39142.pl diff --git a/installer/data/mysql/atomicupdate/Bug_39142.pl b/installer/data/mysql/atomicupdate/Bug_39142.pl new file mode 100755 index 00000000000..aba00480b04 --- /dev/null +++ b/installer/data/mysql/atomicupdate/Bug_39142.pl @@ -0,0 +1,20 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_success say_info); + +return { + bug_number => "39142", + description => "Adding a Debug User permission", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do( + q{ + INSERT IGNORE INTO userflags (bit, flag, flagdesc, defaulton) + VALUES (32, 'debug', 'Show Debug Interface', 0) + } + ); + + say $out "Added new permission 'Debug'"; + }, +}; diff --git a/installer/data/mysql/mandatory/userflags.sql b/installer/data/mysql/mandatory/userflags.sql index 0a30014f66b..f1974d93eb8 100644 --- a/installer/data/mysql/mandatory/userflags.sql +++ b/installer/data/mysql/mandatory/userflags.sql @@ -29,4 +29,5 @@ INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES (29, 'loggedinlibrary', 'Change logged in library', 0), (30, 'preservation', 'Preservation module', 0), (31, 'sip2', 'SIP2 module', 0) +(32, 'debug', 'Show Debug Interface', 0) ; -- 2.51.1