]> git.koha-community.org Git - koha.git/commit
Bug 36056: Clarify subpermissions AND behavior
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 8 Feb 2024 21:29:54 +0000 (21:29 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Tue, 19 Mar 2024 20:40:27 +0000 (20:40 +0000)
commitb9c1f1d12f61d7e27b9c202bd3439f70bc5d3f1b
treeefce9a847c4bb0475de16c4a99c3060fcd7ecc3d
parenta0f3d2a7729ccb447c36b4dec035cfd38277ebf6
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>
(cherry picked from commit aa1049fdd37d87b73c434dfdea11ba691e7095da)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 26ba5fba8be7eee3d931c2d6ef774860145780f0)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
C4/Auth.pm
t/db_dependent/Auth/haspermission.t