From 9f450f416f6ec03deac61736a81a216f1fd96ccc Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 25 Apr 2014 16:45:57 +0200 Subject: [PATCH] Bug 7673: DB changes - Add permissions This patch adds 3 permissions: - edit_items_restricted - delete_all_items - items_batchmod_restricted Signed-off-by: Koha Team AMU --- .../data/mysql/de-DE/mandatory/userpermissions.sql | 3 +++ .../data/mysql/en/mandatory/userpermissions.sql | 3 +++ .../data/mysql/es-ES/mandatory/userpermissions.sql | 3 +++ .../mysql/fr-FR/1-Obligatoire/userpermissions.sql | 3 +++ .../data/mysql/it-IT/necessari/userpermissions.sql | 3 +++ .../mysql/nb-NO/1-Obligatorisk/userpermissions.sql | 3 +++ .../data/mysql/pl-PL/mandatory/userpermissions.sql | 3 +++ installer/data/mysql/updatedatabase.pl | 22 ++++++++++++++++++++ 8 files changed, 43 insertions(+) diff --git a/installer/data/mysql/de-DE/mandatory/userpermissions.sql b/installer/data/mysql/de-DE/mandatory/userpermissions.sql index d80c4d4..25b1d33 100644 --- a/installer/data/mysql/de-DE/mandatory/userpermissions.sql +++ b/installer/data/mysql/de-DE/mandatory/userpermissions.sql @@ -11,6 +11,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_catalogue', 'Katalogdaten bearbeiten (Titel- und Exemplardaten ändern)'), ( 9, 'fast_cataloging', 'Schnellaufnahmen anlegen'), ( 9, 'edit_items', 'Exemplare bearbeiten'), + ( 9, 'edit_items_restricted', 'Limit item modification to barcode, status and note (please note that edit_item is still required)'), + ( 9, 'delete_all_items', 'Delete all items at once'), (10, 'writeoff', 'Gebühren erlassen'), (10, 'remaining_permissions', 'Verbleibende Berechtigungen für die Verwaltung von Gebühren'), (11, 'vendors_manage', 'Lieferanten verwalten'), @@ -43,6 +45,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (13, 'batch_upload_patron_images', 'Benutzerfotos einzeln oder im Stapel hochladen'), (13, 'schedule_tasks', 'Aufgabenplaner verwenden'), (13, 'items_batchmod', 'Stapelbearbeitung von Exemplaren durchführen'), + (13, 'items_batchmod_restricted', 'Limit batch item modification to item status (please note that items_batchmod is still required)'), (13, 'items_batchdel', 'Stapellöschung von Exemplaren durchführen'), (13, 'manage_csv_profiles', 'CSV-Profile für Export verwalten'), (13, 'moderate_tags', 'Von Benutzern vergebene Tags moderieren'), diff --git a/installer/data/mysql/en/mandatory/userpermissions.sql b/installer/data/mysql/en/mandatory/userpermissions.sql index 2533600..55dd19f 100644 --- a/installer/data/mysql/en/mandatory/userpermissions.sql +++ b/installer/data/mysql/en/mandatory/userpermissions.sql @@ -11,6 +11,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'), ( 9, 'fast_cataloging', 'Fast cataloging'), ( 9, 'edit_items', 'Edit Items'), + ( 9, 'edit_items_restricted', 'Limit item modification to barcode, status and note (please note that edit_item is still required)'), + ( 9, 'delete_all_items', 'Delete all items at once'), (10, 'writeoff', 'Write off fines and fees'), (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'), (11, 'vendors_manage', 'Manage vendors'), @@ -43,6 +45,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (13, 'batch_upload_patron_images', 'Upload patron images in a batch or one at a time'), (13, 'schedule_tasks', 'Schedule tasks to run'), (13, 'items_batchmod', 'Perform batch modification of items'), + (13, 'items_batchmod_restricted', 'Limit batch item modification to item status (please note that items_batchmod is still required)'), (13, 'items_batchdel', 'Perform batch deletion of items'), (13, 'manage_csv_profiles', 'Manage CSV export profiles'), (13, 'moderate_tags', 'Moderate patron tags'), diff --git a/installer/data/mysql/es-ES/mandatory/userpermissions.sql b/installer/data/mysql/es-ES/mandatory/userpermissions.sql index 0564d93..c962000 100644 --- a/installer/data/mysql/es-ES/mandatory/userpermissions.sql +++ b/installer/data/mysql/es-ES/mandatory/userpermissions.sql @@ -11,6 +11,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'), ( 9, 'fast_cataloging', 'Fast cataloging'), ( 9, 'edit_items', 'Edit Items'), + ( 9, 'edit_items_restricted', 'Limit item modification to barcode, status and note (please note that edit_item is still required)'), + ( 9, 'delete_all_items', 'Delete all items at once'), (10, 'writeoff', 'Write off fines and fees'), (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'), (11, 'vendors_manage', 'Manage vendors'), @@ -43,6 +45,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (13, 'batch_upload_patron_images', 'Upload patron images in a batch or one at a time'), (13, 'schedule_tasks', 'Schedule tasks to run'), (13, 'items_batchmod', 'Perform batch modification of items'), + (13, 'items_batchmod_restricted', 'Limit batch item modification to item status (please note that items_batchmod is still required)'), (13, 'items_batchdel', 'Perform batch deletion of items'), (13, 'manage_csv_profiles', 'Manage CSV export profiles'), (13, 'moderate_tags', 'Moderate patron tags'), diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql b/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql index 31faf15..b13cbd2 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql @@ -11,6 +11,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_catalogue', 'Ajouter et modifier des notices au catalogue'), ( 9, 'fast_cataloging', 'Catalogage rapide'), ( 9, 'edit_items', 'Modifier des exemplaires'), + ( 9, 'edit_items_restricted', 'Limit item modification to barcode, status and note (please note that edit_item is still required)'), + ( 9, 'delete_all_items', 'Delete all items at once'), (10, 'writeoff', 'Write off fines and fees'), (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'), (13, 'edit_news', 'Ecrire des nouvelles pour l''OPAC et l''interface professionnelle'), @@ -47,6 +49,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (13, 'moderate_tags', 'Modérer les tags des adhérents'), (13, 'rotating_collections', 'Gérer les collections tournantes'), (13, 'items_batchmod', 'Modifier les exemplaires par lot'), + (13, 'items_batchmod_restricted', 'Limit batch item modification to item status (please note that items_batchmod is still required)'), (13, 'items_batchdel', 'Supprimer les exemplaires par lot'), (13, 'upload_local_cover_images', 'Téléchargement des images de couverture'), (13, 'manage_patron_lists', 'Add, edit and delete patron lists and their contents'), diff --git a/installer/data/mysql/it-IT/necessari/userpermissions.sql b/installer/data/mysql/it-IT/necessari/userpermissions.sql index 6b47165..74f9061 100644 --- a/installer/data/mysql/it-IT/necessari/userpermissions.sql +++ b/installer/data/mysql/it-IT/necessari/userpermissions.sql @@ -13,6 +13,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_catalogue', 'Cataloga (crea/modifica dati bibliografici e di copia)'), ( 9, 'fast_cataloging', 'Catalogazione veloce'), ( 9, 'edit_items', 'Crea/modifica copie'), + ( 9, 'edit_items_restricted', 'Limit item modification to barcode, status and note (please note that edit_item is still required)'), + ( 9, 'delete_all_items', 'Delete all items at once'), (10, 'writeoff', 'Write off fines and fees'), (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'), (11, 'vendors_manage', 'Crea/modifica fornitori'), @@ -45,6 +47,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (13, 'batch_upload_patron_images', 'Aggiorna le foto utente in modalità batch o al momento'), (13, 'schedule_tasks', 'Schedula i task da far andare'), (13, 'items_batchmod', 'Abilita alla modifica batch delle copie'), + (13, 'items_batchmod_restricted', 'Limit batch item modification to item status (please note that items_batchmod is still required)'), (13, 'items_batchdel', 'Abilita alla cancellazione via batch delle copie'), (13, 'manage_csv_profiles', 'Gestisci i profili CSV di export'), (13, 'moderate_tags', 'Modera i tag inseriti dagli utenti'), diff --git a/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql b/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql index dfe5ebb..6a4f00a 100644 --- a/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql +++ b/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql @@ -31,6 +31,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_catalogue', 'Endre katalogen (Endre bibliografiske poster og eksemplaropplysninger)'), ( 9, 'fast_cataloging', 'Hurtigkatalogisering'), ( 9, 'edit_items', 'Endre eksmeplarer'), + ( 9, 'edit_items_restricted', 'Limit item modification to barcode, status and note (please note that edit_item is still required)'), + ( 9, 'delete_all_items', 'Delete all items at once'), (10, 'writeoff', 'Write off fines and fees'), (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'), (11, 'vendors_manage', 'Administrere leverandører'), @@ -63,6 +65,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (13, 'batch_upload_patron_images', 'Laste opp bilder av lånere enkeltvis eller en masse'), (13, 'schedule_tasks', 'Planlegge oppgaver som skal kjøres'), (13, 'items_batchmod', 'Utføre masseendringer av eksemplarer'), + (13, 'items_batchmod_restricted', 'Limit batch item modification to item status (please note that items_batchmod is still required)'), (13, 'items_batchdel', 'Utføre masseslettinger av eksemplarer'), (13, 'manage_csv_profiles', 'Administrere CSV eksportprofiler'), (13, 'moderate_tags', 'Behandle tagger fra lånere'), diff --git a/installer/data/mysql/pl-PL/mandatory/userpermissions.sql b/installer/data/mysql/pl-PL/mandatory/userpermissions.sql index b9fbee4..818d7c7 100644 --- a/installer/data/mysql/pl-PL/mandatory/userpermissions.sql +++ b/installer/data/mysql/pl-PL/mandatory/userpermissions.sql @@ -11,6 +11,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_catalogue', 'Edit catalogue'), ( 9, 'fast_cataloging', 'Szybkie katalogowanie'), ( 9, 'edit_items', 'Edit Items'), + ( 9, 'edit_items_restricted', 'Limit item modification to barcode, status and note (please note that edit_item is still required)'), + ( 9, 'delete_all_items', 'Delete all items at once'), (10, 'writeoff', 'Write off fines and fees'), (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'), (11, 'vendors_manage', 'Zarządzanei dostawcami'), @@ -43,6 +45,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (13, 'batch_upload_patron_images', 'Upload patron images in a batch or one at a time'), (13, 'schedule_tasks', 'Schedule tasks to run'), (13, 'items_batchmod', 'Perform batch modification of items'), + (13, 'items_batchmod_restricted', 'Limit batch item modification to item status (please note that items_batchmod is still required)'), (13, 'items_batchdel', 'Perform batch deletion of items'), (13, 'manage_csv_profiles', 'Manage CSV export profiles'), (13, 'moderate_tags', 'Moderate patron tags'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 3b1718c..c94ba31 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -8465,6 +8465,28 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.15.00.XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do(q{ + INSERT INTO permissions (module_bit, code, description) VALUES ('9', 'edit_items_restricted', 'Limit item modification to barcode, status and note (please note that edit_item is still required)'); + }); + + $dbh->do(q{ + INSERT INTO permissions (module_bit, code, description) VALUES ('9', 'delete_all_items', 'Delete all items at once'); + }); + + $dbh->do(q{ + INSERT INTO permissions (module_bit, code, description) VALUES ('13', 'items_batchmod_restricted', 'Limit batch item modification to item status (please note that items_batchmod is still required)'); + }); + + # The delete_all_items permission should be added to users having the edit_items permission. + $dbh->do(q{ + INSERT INTO user_permissions (borrowernumber, module_bit, code) SELECT borrowernumber, module_bit, "delete_all_items" FROM user_permissions WHERE code="edit_items"; + }); + print "Upgrade to $DBversion done (Bug 7673: Adds new permissions edit_items_restricted, delete_all_items and items_batchmod_restricted)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) -- 1.7.10.4