Looking at C4::Auth::haspermission, it looks like it allows checking: { perm => { subperm_a => 1, subperm_b => 1 } } treating it like subperm_a AND subperm_b. But this use case is not documented. We should add tests and add it to the POD.
Created attachment 161957 [details] [review] Bug 36056: Clarify subpermissions AND behavior Working on bug 31791, I found myself wondering if our current recursive code in C4::Auth::haspermission() would allow checking AND on subpermissions. As it is not documented in the POD or tested, I decided to write some unit tests for it. It turned out it was well supported, so I decided to submit the tests, and a small tweak in the POD to reflect that. To test: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Auth/haspermission.t => SUCCESS: Tests pass! The code supports AND on subpermissions! 3. Sign off :-D
Created attachment 161958 [details] [review] Bug 36056: Clarify subpermissions AND behavior Working on bug 31791, I found myself wondering if our current recursive code in C4::Auth::haspermission() would allow checking AND on subpermissions. As it is not documented in the POD or tested, I decided to write some unit tests for it. It turned out it was well supported, so I decided to submit the tests, and a small tweak in the POD to reflect that. To test: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Auth/haspermission.t => SUCCESS: Tests pass! The code supports AND on subpermissions! 3. Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Straight QA here, simple improvements to clarify and enhance testing of existing functionality. Thanks Tomas
Pushed for 24.05! Well done everyone, thank you!
Pushed to 23.11.x for 23.11.04
Backported to 23.05.x for upcoming 23.05.10.