]> git.koha-community.org Git - koha.git/commit
Bug 26322: Permissions not checked correctly for plugins
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 31 Aug 2020 12:43:09 +0000 (09:43 -0300)
committerLucas Gass <lucas@bywatersolutions.com>
Tue, 22 Sep 2020 23:12:43 +0000 (23:12 +0000)
commit5a5d1b80890a50fdd1a11867bbd9f4c246ee8600
treebfc5670a34b5ff9a3afa895ab74bcec2ae0fc3dc
parent44a1c3edca1fd7a3d742c3be283d9a489fd1d34a
Bug 26322: Permissions not checked correctly for plugins

This patch fixes the logic in a condition to address the fact that
permissions are not checked for plugins. This was due to bad parenthesis
pairing and the lack of good tests for this.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/PluginRoutes.t
=> FAIL: Tests fail because of bad logic
3. Apply this patch
4. Repeat (2)
=> SUCCESS: Tests pass!
5. Verify the tests cover the use cases that are needed:
   - Anonymous access
   - Real user with wrong permissions (parameters => 1)
   - Real user with right permissions (borrowers => 1)
=> SUCCESS: Needed use cases so we catch any regression are found
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 66402643d7cb95bf5ebc4832bff61becfa3d5a6a)
Koha/REST/V1/Auth.pm