Bugzilla – Attachment 161256 Details for
Bug 29509
GET /patrons* routes permissions excessive
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29509: WIP - Start of DB and specification update
Bug-29509-WIP---Start-of-DB-and-specification-upda.patch (text/plain), 2.54 KB, created by
Martin Renvoize (ashimema)
on 2024-01-22 16:50:34 UTC
(
hide
)
Description:
Bug 29509: WIP - Start of DB and specification update
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-01-22 16:50:34 UTC
Size:
2.54 KB
patch
obsolete
>From 70a71ce1f5eda18c8c66616324e2c4f55fb5bec1 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 22 Jan 2024 16:49:56 +0000 >Subject: [PATCH] Bug 29509: WIP - Start of DB and specification update > >--- > 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 > >diff --git a/api/v1/swagger/paths/patrons.yaml b/api/v1/swagger/paths/patrons.yaml >index 641ba4f1ae1..02894e2dd05 100644 >--- a/api/v1/swagger/paths/patrons.yaml >+++ b/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 >diff --git a/installer/data/mysql/atomicupdate/bug_29509.pl b/installer/data/mysql/atomicupdate/bug_29509.pl >new file mode 100644 >index 00000000000..5a8b0714ebb >--- /dev/null >+++ b/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 >+ }, >+}; >-- >2.43.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29509
:
161256
|
161268
|
161269
|
161270
|
161271
|
162579
|
162580
|
162690
|
162691
|
164461
|
166280
|
169235
|
169236
|
169237