Bug 36056: Clarify subpermissions AND behavior
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 8 Feb 2024 21:29:54 +0000 (21:29 +0000)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Thu, 7 Mar 2024 16:35:40 +0000 (17:35 +0100)
commitaa1049fdd37d87b73c434dfdea11ba691e7095da
treeaafcb9d86dc9c4bb13dd7eca52aa01189de2ac41
parent5e0afb772a4a2b100ee14c1da0c323fcc32d0fb2
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>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
C4/Auth.pm
t/db_dependent/Auth/haspermission.t