[Bug 35468] New: Bookings permission mismatch
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Bug ID: 35468 Summary: Bookings permission mismatch Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com git grep manage_bookings The api routes require: parameters: manage_bookings The permission is defined as: circulate: manage_bookings -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@ptfs-europe |ity.org |.com Depends on| |29002 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29002 [Bug 29002] Add ability to book items ahead of time -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 159734 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159734&action=edit Bug 35468: Correct api bookings permission At some point during development we migrated from 'parameters' to 'circulate' for the manage_bookings sub-permission. Unfortunately, the corresponsing API definition missed the update. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 159746 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159746&action=edit Bug 35468: Unit tests This patch adds all the 'basic' unit tests one would expect to find with the api endpoints. I've been working on this as a follow-up to bug 29002 as promised, but hadn't yet submitted them as I wanted to get the full coverage.. but having these basics in early makes sense whilst I continue on the more advanced cases. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #159734|0 |1 is obsolete| | Attachment #159746|0 |1 is obsolete| | --- Comment #3 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 159754 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159754&action=edit Bug 35468: Correct api bookings permission At some point during development we migrated from 'parameters' to 'circulate' for the manage_bookings sub-permission. Unfortunately, the corresponsing API definition missed the update. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 159755 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159755&action=edit Bug 35468: Unit tests This patch adds all the 'basic' unit tests one would expect to find with the api endpoints. I've been working on this as a follow-up to bug 29002 as promised, but hadn't yet submitted them as I wanted to get the full coverage.. but having these basics in early makes sense whilst I continue on the more advanced cases. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #5 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 159756 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159756&action=edit Bug 35468: (follow-up) Fix QA complaints Tidyness Use dt_from_string, not DateTime->now Add exec flag Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #6 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 159757 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159757&action=edit Bug 35468: (follow-up) Test only the specific permission needed The tests were granting circulation top-level permissions - we should be able to perform the actions with only 'manage_bookings'. This patch updates the tests to use the narrower permission. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- That's a great follow-up, thanks Nick.. I hadn't the brain power at the moment I was writing those tests to remember how to narrow it down that far :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #159754|0 |1 is obsolete| | Attachment #159755|0 |1 is obsolete| | Attachment #159756|0 |1 is obsolete| | Attachment #159757|0 |1 is obsolete| | --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 159789 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159789&action=edit Bug 35468: Correct api bookings permission At some point during development we migrated from 'parameters' to 'circulate' for the manage_bookings sub-permission. Unfortunately, the corresponsing API definition missed the update. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 159790 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159790&action=edit Bug 35468: Unit tests This patch adds all the 'basic' unit tests one would expect to find with the api endpoints. I've been working on this as a follow-up to bug 29002 as promised, but hadn't yet submitted them as I wanted to get the full coverage.. but having these basics in early makes sense whilst I continue on the more advanced cases. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 159791 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159791&action=edit Bug 35468: (follow-up) Fix QA complaints Tidyness Use dt_from_string, not DateTime->now Add exec flag Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 159792 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159792&action=edit Bug 35468: (follow-up) Test only the specific permission needed The tests were granting circulation top-level permissions - we should be able to perform the actions with only 'manage_bookings'. This patch updates the tests to use the narrower permission. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Trivial fix. Nice to see tests finally added for the feature. QA script happy. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #159789|0 |1 is obsolete| | Attachment #159790|0 |1 is obsolete| | Attachment #159791|0 |1 is obsolete| | Attachment #159792|0 |1 is obsolete| | --- Comment #13 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 159793 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159793&action=edit Bug 35468: Correct api bookings permission At some point during development we migrated from 'parameters' to 'circulate' for the manage_bookings sub-permission. Unfortunately, the corresponsing API definition missed the update. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #14 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 159794 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159794&action=edit Bug 35468: Unit tests This patch adds all the 'basic' unit tests one would expect to find with the api endpoints. I've been working on this as a follow-up to bug 29002 as promised, but hadn't yet submitted them as I wanted to get the full coverage.. but having these basics in early makes sense whilst I continue on the more advanced cases. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 159795 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159795&action=edit Bug 35468: (follow-up) Fix QA complaints Tidyness Use dt_from_string, not DateTime->now Add exec flag Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #16 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 159796 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159796&action=edit Bug 35468: (follow-up) Test only the specific permission needed The tests were granting circulation top-level permissions - we should be able to perform the actions with only 'manage_bookings'. This patch updates the tests to use the narrower permission. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #17 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com Keywords| |additional_work_needed --- Comment #18 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- koha_1 | # Failed test 'list() tests' koha_1 | # at t/db_dependent/api/v1/bookings.t line 142. koha_1 | Can't locate object method "rfc3339" via package "DateTime" at t/db_dependent/api/v1/bookings.t line 124. Oops https://metacpan.org/dist/DateTime/changes 1.53 2020-11-08 - Added a $dt->rfc3339 method. Based on discussion in GH #109 by worthmine. buster (oldoldstable): 2:1.50 bullseye (oldstable): 2:1.54 bookworm (stable): 2:1.59 focal (20.04LTS): 2:1.51 jammy (22.04LTS): 2:1.55 lunar (23.04): 2:1.59 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=35574 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=35469 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #19 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 159881 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159881&action=edit Bug 35468: (follow-up) Fix for older DateTimes We can't use the rfc3339 method from DateTime itself as older Debians don't ship with a recent enough version. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #20 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- That follow-up should make Jenkins happy again everywhere :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #21 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I fail to get the perltidy QA test happy on this last patch. I verified all changed lines would not change when I perltidied them in my editor. Any ideas? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #22 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Katrin Fischer from comment #21)
I fail to get the perltidy QA test happy on this last patch. I verified all changed lines would not change when I perltidied them in my editor. Any ideas?
I fully tidied the file and the diff was empty. I would skip that as a false positive. Maybe worth using it as a test case to enhance the QA tools, but I don't have the time today to get a deep dive into it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #23 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Tomás Cohen Arazi from comment #22)
(In reply to Katrin Fischer from comment #21)
I fail to get the perltidy QA test happy on this last patch. I verified all changed lines would not change when I perltidied them in my editor. Any ideas?
I fully tidied the file and the diff was empty. I would skip that as a false positive. Maybe worth using it as a test case to enhance the QA tools, but I don't have the time today to get a deep dive into it.
Same for me, twice (once with older, once with current perltidy version) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #24 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 --- Comment #25 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- root@kohadevbox:koha$ perltidy t/db_dependent/api/v1/bookings.t root@kohadevbox:koha$ diff t/db_dependent/api/v1/bookings.t* 89,90c89,90 < my $start_1 = dt_from_string->add( days => 1 )->truncate( to => 'day' ); < my $end_1 = dt_from_string->add( days => 6 )->truncate( to => 'day' ); ---
my $start_1 = dt_from_string->add( days => 1 )->truncate( to => 'day' ); my $end_1 = dt_from_string->add( days => 6 )->truncate( to => 'day' );
101,102c101,102 < my $start_2 = dt_from_string->add( days => 4 )->truncate( to => 'day' ); < my $end_2 = dt_from_string->add( days => 8 )->truncate( to => 'day' ); ---
my $start_2 = dt_from_string->add( days => 4 )->truncate( to => 'day' ); my $end_2 = dt_from_string->add( days => 8 )->truncate( to => 'day' );
Seems easy to recreate. ktd: This is perltidy, v20200110 However new version has a different output (host): v20210717 This will appear until we embed the new version in ktd, see bug 30002 comment 49. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|24.05.00 |24.05.00,23.11.02 released in| | Status|Pushed to master |Pushed to stable CC| |fridolin.somers@biblibre.co | |m --- Comment #26 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Resolution|--- |FIXED Status|Pushed to stable |RESOLVED --- Comment #27 from Lucas Gass <lucas@bywatersolutions.com> --- Dependencies missing for 23.05.x, no backport. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |36100 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36100 [Bug 36100] Regression in bookings edit -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35468 Bug 35468 depends on bug 29002, which changed state. Bug 29002 Summary: Add ability to book items ahead of time https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29002 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org