From 66aa19120c6e58fcc9063fa1b7382baeb799aee9 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 | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) 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..7dd68de46da --- /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 (31, '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 8e9fad25260..45e552d6f81 100644 --- a/installer/data/mysql/mandatory/userflags.sql +++ b/installer/data/mysql/mandatory/userflags.sql @@ -27,5 +27,6 @@ INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES (27, 'recalls', 'Recalls', 0), (28, 'erm', 'Manage electronic resources', 0), (29, 'loggedinlibrary', 'Change logged in library', 0), -(30, 'preservation', 'Preservation module', 0) +(30, 'preservation', 'Preservation module', 0), +(31, 'debug', 'Show Debug Interface', 0) ; -- 2.51.0