@@ -, +, @@ --- api/v1/swagger/paths/patrons.yaml | 5 ---- .../data/mysql/atomicupdate/bug_29509.pl | 27 +++++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_29509.pl --- a/api/v1/swagger/paths/patrons.yaml +++ a/api/v1/swagger/paths/patrons.yaml @@ -394,11 +394,6 @@ x-koha-authorization: permissions: - borrowers: "list_borrowers" - - borrowers: "edit_borrowers" - - circulate: "manage_bookings" - - tools: "label_creator" - - serials: "routing" - - acquisition: "order_manage" post: x-mojo-to: Patrons#add operationId: addPatron --- a/installer/data/mysql/atomicupdate/bug_29509.pl +++ a/installer/data/mysql/atomicupdate/bug_29509.pl @@ -0,0 +1,27 @@ +use Modern::Perl; + +return { + bug_number => "29509", + description => "Update users with list_borrowers permission where required", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do( + "INSERT IGNORE INTO permissions (module_bit, code, description) VALUES (4, 'list_borrowers', 'Search, list and view patrons')" + ); + + # Check for 'borrowers' or 'borrowers > edit_borrowers' permission + say $out "list_borrowers added to all users with edit_borrowers"; + # Check for 'circulate' or 'circulate > manage_bookings' permission + say $out "list_borrowers added to all users with manage_bookings"; + # Check for 'tools' or 'tools > label_creator' permission + say $out "list_borrowers added to all users with label_creator"; + # Check for 'serials' or 'serials > routing' permission + say $out "list_borrowers added to all users with routing"; + # Check for 'acquisitions' or 'acquisitions > order_manage' permission + say $out "list_borrowers added to all users with order_manage"; + + # Checks above should also confirm users don't already have top level 'borrowers' permission before adding the sub-permission + }, +}; --