Bug 17387: add restore records permission as child of cataloguing perms

Signed-off-by: Michaela <michaela.sieber@kit.edu>
Sponsored-by: ByWater Solutions
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jacob O'Mara 2025-10-30 13:16:51 +00:00 committed by Lucas Gass
parent f2396c5389
commit f4c154f155
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
7 changed files with 29 additions and 3 deletions

View File

@ -2329,6 +2329,7 @@ sub get_cataloguing_page_permissions {
marc_modification_templates
records_batchdel
records_batchmod
records_restore
stage_marc_import
upload_cover_images
);

View File

@ -171,4 +171,4 @@
$ref: "../swagger.yaml#/definitions/error"
x-koha-authorization:
permissions:
editcatalogue: edit_catalogue
tools: records_restore

View File

@ -164,4 +164,4 @@
$ref: "../swagger.yaml#/definitions/error"
x-koha-authorization:
permissions:
editcatalogue: edit_catalogue
tools: records_restore

View File

@ -0,0 +1,21 @@
use Modern::Perl;
use Koha::Installer::Output qw(say_warning say_success say_info);
return {
bug_number => "17387",
description => "Add records_restore permission",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
$dbh->do(
q{
INSERT IGNORE INTO permissions (module_bit, code, description)
VALUES (13, 'records_restore', 'Restore deleted records')
}
);
say_success( $out, "Added new permission 'tools:records_restore'" );
},
};

View File

@ -133,6 +133,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES
(13, 'records_batchmod', 'Perform batch modification of records (biblios or authorities)'),
(13, 'marc_modification_templates', 'Manage marc modification templates'),
(13, 'records_batchdel', 'Perform batch deletion of records (bibliographic or authority)'),
(13, 'records_restore', 'Restore deleted records'),
(13, 'access_files', 'Access to the files stored on the server'),
(13, 'upload_general_files', 'Upload any file'),
(13, 'upload_manage', 'Manage uploaded files'),

View File

@ -463,6 +463,9 @@
[%- CASE 'records_batchmod' -%]
<span class="sub_permission records_batchmod_subpermission"> Perform batch modification of records (biblios or authorities) </span>
<span class="permissioncode">([% name | html %])</span>
[%- CASE 'records_restore' -%]
<span class="sub_permission records_restore_subpermission"> Restore deleted records </span>
<span class="permissioncode">([% name | html %])</span>
[%- CASE 'rotating_collections' -%]
<span class="sub_permission rotating_collections_subpermission"> Manage rotating collections </span>
<span class="permissioncode">([% name | html %])</span>

View File

@ -29,7 +29,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
template_name => "tools/restore-records.tt",
query => $input,
type => "intranet",
flagsrequired => { editcatalogue => 'edit_catalogue' },
flagsrequired => { tools => 'records_restore' },
}
);