Bug 20100: Introduce preference ProtectSuperlibPrivs
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Wed, 31 Jan 2018 15:23:18 +0000 (16:23 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 25 Apr 2018 13:23:53 +0000 (10:23 -0300)
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 <m.de.rooy@rijksmuseum.nl>
Signed-off-by: JM Broust <jean-manuel.broust@univ-lyon2.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
installer/data/mysql/atomicupdate/bug_20100.perl [new file with mode: 0644]
installer/data/mysql/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref

diff --git a/installer/data/mysql/atomicupdate/bug_20100.perl b/installer/data/mysql/atomicupdate/bug_20100.perl
new file mode 100644 (file)
index 0000000..937656a
--- /dev/null
@@ -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";
+}
index 53bea29..f951ea4 100644 (file)
@@ -443,6 +443,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'),
index f1af818..f484df4 100644 (file)
@@ -199,6 +199,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