From 4ac6e928b18e426738b87914833e579f875803f1 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 31 Jan 2018 16:23:18 +0100 Subject: [PATCH] Bug 20100: Introduce preference ProtectSuperlibPrivs Content-Type: text/plain; charset=utf-8 This pref allows you to block changes to superlibrarian privileges at client and server side for non-superlibrarians. This patch only contains the db rev and the preference description. Test plan: Run dbrev or new install. Check pref value. Signed-off-by: Marcel de Rooy --- installer/data/mysql/atomicupdate/bug_20100.perl | 9 +++++++++ installer/data/mysql/sysprefs.sql | 1 + .../intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref | 7 +++++++ 3 files changed, 17 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_20100.perl diff --git a/installer/data/mysql/atomicupdate/bug_20100.perl b/installer/data/mysql/atomicupdate/bug_20100.perl new file mode 100644 index 0000000..937656a --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_20100.perl @@ -0,0 +1,9 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( q| +INSERT IGNORE INTO systempreferences ( value, variable, options, explanation, type ) VALUES ( '0', 'ProtectSuperlibPrivs', NULL, 'If enabled, non-superlibrarians cannot set superlibrarian privileges', 'YesNo' ); + |); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 20100: Should a non-superlibrarian be able to add superlibrarian privileges?)\n"; +} diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 76bb2cc..f9f8e6b 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -440,6 +440,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('printcirculationslips','1','','If ON, enable printing circulation receipts','YesNo'), ('PrintNoticesMaxLines','0','','If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.','Integer'), ('ProcessingFeeNote', '', NULL, 'Set the text to be recorded in the column note, table accountlines when the processing fee (defined in item type) is applied', 'textarea'), +('ProtectSuperlibPrivs','0',NULL,'If enabled, non-superlibrarians cannot set superlibrarian privileges','YesNo'), ('PurgeSuggestionsOlderThan', '', NULL, 'If this script is called without the days parameter', 'Integer'), ('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'), ('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index fe4da67..713b5ef 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -205,6 +205,13 @@ Patrons: - pref: FailedLoginAttempts class: integer - failed login attempts. + - + - pref: ProtectSuperlibPrivs + choices: + yes: Allow only superlibrarians + no: Do not block permitted non-superlibrarians + - to access/change superlibrarian privileges. + "Norwegian patron database": - - pref: NorwegianPatronDBEnable -- 2.1.4