Summary: | Refactor C4::Auth::haspermission() to Koha::Object and return better errors. | ||
---|---|---|---|
Product: | Koha | Reporter: | Olli-Antti Kivilahti <olli-antti.kivilahti> |
Component: | Authentication | Assignee: | Olli-Antti Kivilahti <olli-antti.kivilahti> |
Status: | CLOSED INVALID | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | dpavlin, jonathan.druart |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 13995 | ||
Bug Blocks: | 13920 | ||
Attachments: |
Bug 14437 - Refactor C4::Auth::haspermission() to Koha::Object and return better errors.
Bug 14437 - Refactor C4::Auth::haspermission() to Koha::Object and return better errors. Bug 14437 - Refactor C4::Auth::haspermission() to Koha::Object and return better errors. Bug 14437 - Refactor C4::Auth::haspermission() to Koha::Object and return better errors. |
Description
Olli-Antti Kivilahti
2015-06-23 09:17:11 UTC
Created attachment 40513 [details] [review] Bug 14437 - Refactor C4::Auth::haspermission() to Koha::Object and return better errors. Refactoring haspermission() and improving documentation. Also added a return value unintrusively (in the old context still RETURNS the same result) to tell which permission failed. Modification should have no adverse effects, other than killing the process (by throwing uncaught exceptions) if no valid parameters are given. Depends on Buugg 13995 - Proper Exception handling so apply it first. Cannot create unit tests because there is no CRUD interface for permissions. Not even with TestBuilder. TEST PLAN: 1. Find a borrower with only the catalogue-permission. 2. try opening this page cgi-bin/koha/tools/manage-marc-import.pl 3. You get "Permission denied" Created attachment 40571 [details] [review] Bug 14437 - Refactor C4::Auth::haspermission() to Koha::Object and return better errors. Created attachment 40718 [details] [review] Bug 14437 - Refactor C4::Auth::haspermission() to Koha::Object and return better errors. Created attachment 40719 [details] [review] Bug 14437 - Refactor C4::Auth::haspermission() to Koha::Object and return better errors. Comment on attachment 40719 [details] [review] Bug 14437 - Refactor C4::Auth::haspermission() to Koha::Object and return better errors. Review of attachment 40719 [details] [review]: ----------------------------------------------------------------- ::: C4/Auth.pm @@ +38,5 @@ > use List::MoreUtils qw/ any /; > use Encode qw( encode is_utf8); > > +use Koha::Exception::BadParameter; > +use Koha::Exception::UnknownObject; So should depend on bug 13995. |