@@ -, +, @@ --- api/v1/swagger/paths/biblios_volumes.json | 14 +++++----- .../data/mysql/atomicupdate/volumes.perl | 5 ++++ installer/data/mysql/userpermissions.sql | 1 + .../prog/en/includes/permissions.inc | 5 ++++ .../prog/en/modules/catalogue/detail.tt | 28 +++++++++++-------- .../prog/en/modules/cataloguing/additem.tt | 2 +- 6 files changed, 36 insertions(+), 19 deletions(-) --- a/api/v1/swagger/paths/biblios_volumes.json +++ a/api/v1/swagger/paths/biblios_volumes.json @@ -70,7 +70,7 @@ }, "x-koha-authorization": { "permissions": { - "catalogue": "1" + "catalogue": "CAN_user_editcatalogue_manage_volumes" } }, "x-koha-embed": [ @@ -169,7 +169,7 @@ }, "x-koha-authorization": { "permissions": { - "catalogue": "1" + "catalogue": "CAN_user_editcatalogue_manage_volumes" } } } @@ -240,7 +240,7 @@ ], "x-koha-authorization": { "permissions": { - "catalogue": "1" + "catalogue": "CAN_user_editcatalogue_manage_volumes" } } }, @@ -337,7 +337,7 @@ }, "x-koha-authorization": { "permissions": { - "catalogue": "1" + "catalogue": "CAN_user_editcatalogue_manage_volumes" } }, "x-koha-embed": [ @@ -409,7 +409,7 @@ }, "x-koha-authorization": { "permissions": { - "catalogue": "1" + "catalogue": "CAN_user_editcatalogue_manage_volumes" } } } @@ -501,7 +501,7 @@ }, "x-koha-authorization": { "permissions": { - "catalogue": "1" + "catalogue": "CAN_user_editcatalogue_manage_volumes" } }, "x-koha-embed": [ @@ -585,7 +585,7 @@ }, "x-koha-authorization": { "permissions": { - "catalogue": "1" + "catalogue": "CAN_user_editcatalogue_manage_volumes" } } } --- a/installer/data/mysql/atomicupdate/volumes.perl +++ a/installer/data/mysql/atomicupdate/volumes.perl @@ -5,6 +5,11 @@ if ( CheckVersion( $DBversion ) ) { ('EnableVolumes','0','','Enable volumes feature','YesNo'); }); + $dbh->do(q{ + INSERT INTO permissions (module_bit, code, description) VALUES + ( 9, 'manage_volumes', 'Create, update and delete volumes, add or remove items from a volume'); + }); + unless ( TableExists('volumes') ) { $dbh->do(q{ CREATE TABLE `volumes` ( -- information related to bibliographic records in Koha --- a/installer/data/mysql/userpermissions.sql +++ a/installer/data/mysql/userpermissions.sql @@ -46,6 +46,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_items', 'Edit items'), ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'), ( 9, 'delete_all_items', 'Delete all items at once'), + ( 9, 'manage_volumes', 'Create, update and delete volumes, add or remove items from a volume'), (10, 'payout', 'Perform account payout action'), (10, 'refund', 'Perform account refund action'), (10, 'discount', 'Perform account discount action'), --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -315,6 +315,11 @@ Fast cataloging ([% name | html %]) + [%- CASE 'manage_volumes' -%] + + Create, update and delete volumes, add or remove items from a volume + + ([% name | html %]) [%- CASE 'remaining_permissions' -%] Remaining permissions for managing fines and fees --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -279,7 +279,7 @@ [% IF CAN_user_tools_items_batchmod %] Modify selected items [% END %] - [% IF biblio.volumes.count %] + [% IF CAN_user_editcatalogue_manage_volumes && biblio.volumes.count %] Add/move to volume Remove from volume [% END %] @@ -552,9 +552,11 @@ Note that permanent location is a code, and location may be an authval. [% IF Koha.Preference('EnableVolumes') %]
- + [% IF CAN_user_editcatalogue_manage_volumes %] + + [% END %] @@ -1444,13 +1446,17 @@ Note that permanent location is a code, and location may be an authval. }, { "mDataProp": function( oObj ) { - return `` - + ' ' - + ``; + [% IF CAN_user_editcatalogue_manage_volumes %] + return `` + + ' ' + + ``; + [% ELSE %] + return ""; + [% END %] }, }, ], --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -234,7 +234,7 @@ -[% IF volumes.count && op != 'saveitem' %] +[% IF volumes.count && op != 'saveitem' && CAN_user_editcatalogue_manage_volumes %]
Add to volume [% FOREACH v IN volumes %] --