Bug 22483: Explicitly ban 'undef' as a valid $flagsrequired
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 8 Mar 2019 12:24:17 +0000 (12:24 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 8 Mar 2019 18:26:04 +0000 (15:26 -0300)
commitcc67ff26aad6e6d429a65d6ea3ffb2226b25ab51
tree9fbfb874879e247f101b90d80f83a7d4cbbba96d
parent255af719e65956d84d62ea52fea12619bb851f70
Bug 22483: Explicitly ban 'undef' as a valid $flagsrequired

Before bug 22031 the haspermission subroutine signature allowed for
passing 'undef' to mean 'any permission' in $flagsrequired.  This feels
like a mistake and was only in practical use in two places in the
codebase.

This patch explicitly forbids this practice (`*` may be used to the same
result and is more explicit in it's nature) and replaces the two
instances of it's use.

Test Plan
1. Before this patch, the API tests are all failing with authentication
errors
2. After this patch the API tests should now all pass.
3. t/db_dependent/Auth/haspermission.t should continue to pass (with one
addition subtest added herin)
3. /svc/members/search is not unit tested. Please check that patron
searching still yields results in the UI after this patch.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
C4/Auth.pm
Koha/REST/V1/Auth.pm
svc/members/search
t/db_dependent/Auth/haspermission.t