[Koha-bugs] [Bug 22483] haspermissions used to support passing 'undef' for $flagsrequired

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Mar 8 13:31:24 CET 2019


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22483

--- Comment #1 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Created attachment 86379
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86379&action=edit
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 at ptfs-europe.com>

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list