From 28a2f48ea82f05e1f51fd0efce378e10bcf414d4 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 2 Feb 2024 16:24:58 -0300 Subject: [PATCH] Bug 31791: DB changes Sponsored-by: ByWater Solutions Signed-off-by: Martin Renvoize Signed-off-by: Lucas Gass Signed-off-by: Arthur Suzuki Signed-off-by: Katrin Fischer --- .../data/mysql/atomicupdate/bug_31791.pl | 26 +++++++++++++++++++ .../data/mysql/mandatory/userpermissions.sql | 2 ++ 2 files changed, 28 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_31791.pl diff --git a/installer/data/mysql/atomicupdate/bug_31791.pl b/installer/data/mysql/atomicupdate/bug_31791.pl new file mode 100755 index 0000000000..3d1998c55a --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_31791.pl @@ -0,0 +1,26 @@ +use Modern::Perl; + +return { + bug_number => "31791", + description => "Add the ability to lock record modification", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do( + q{ + INSERT IGNORE INTO permissions (module_bit, code, description) VALUES + ( 9, 'edit_locked_records', 'Edit locked records'); + } + ); + say $out "Added new permission 'editcatalogue.edit_locked_records'"; + + $dbh->do( + q{ + INSERT IGNORE INTO permissions (module_bit, code, description) VALUES + ( 9, 'set_record_sources', 'Set record source for records'); + } + ); + say $out "Added new permission 'editcatalogue.set_record_sources'"; + }, +}; diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql index e27a8749b4..a132b83e20 100644 --- a/installer/data/mysql/mandatory/userpermissions.sql +++ b/installer/data/mysql/mandatory/userpermissions.sql @@ -61,6 +61,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'manage_item_groups', 'Create, update and delete item groups, add or remove items from a item groups'), ( 9, 'manage_item_editor_templates', 'Update and delete item editor template owned by others'), ( 9, 'edit_any_item', 'Edit any item regardless of home library'), + ( 9, 'edit_locked_records', 'Edit locked records'), + ( 9, 'set_record_sources', 'Set record source'), (10, 'payout', 'Perform account payout action'), (10, 'refund', 'Perform account refund action'), (10, 'discount', 'Perform account discount action'), -- 2.39.5