Bug 26017 - Cashup registers never shows on tools page
Summary: Cashup registers never shows on tools page
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Martin Renvoize
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 26023 25764
  Show dependency treegraph
 
Reported: 2020-07-18 02:05 UTC by Katrin Fischer
Modified: 2020-08-16 22:22 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.03


Attachments
Bug 26017: Correct permission check on tools page (1.55 KB, patch)
2020-07-20 08:47 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 26017: Correct permission check on tools page (1.59 KB, patch)
2020-07-22 18:23 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 26017: Correct permission check on tools page (1.89 KB, patch)
2020-07-25 08:27 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 26017: Correct permission check on tools page (1.89 KB, patch)
2020-08-04 14:07 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 26017: (follow-up) Serverside permission check on registers page (929 bytes, patch)
2020-08-04 14:07 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2020-07-18 02:05:43 UTC
There is a permission check error here:
    [% IF ( Koha.Preference('UseCashRegisters') && CAN_user_cash_management_manage_cash_registers ) %]

Martin, can you tell which was the intended permission? This one doesn't exist. Either the first or second part of the permission is wrong, but I am not sure what is meant.
Comment 1 Martin Renvoize 2020-07-20 08:47:22 UTC
Created attachment 107080 [details] [review]
Bug 26017: Correct permission check on tools page

The 'Cashup registers' link from the tools page retained an previous
verions of the permission name. This patch corrects it to use the final
name we sebtled on and thus now correctly displays the link when
appropriate.
Comment 2 Michal Denar 2020-07-21 21:00:38 UTC
Hi, any test plan for this patch?
Comment 3 Martin Renvoize 2020-07-22 06:42:34 UTC
Test plan
1/ Enable cash registers via the 'UseCashRegisters' system preference
2/ Ensure you are logged in as a user who has the cash management cashup permission.
3/ Verify that the 'Cashup registers' option appears on the tools page.
Comment 4 Michal Denar 2020-07-22 18:23:26 UTC
Created attachment 107197 [details] [review]
Bug 26017: Correct permission check on tools page

The 'Cashup registers' link from the tools page retained an previous
verions of the permission name. This patch corrects it to use the final
name we sebtled on and thus now correctly displays the link when
appropriate.

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 5 Katrin Fischer 2020-07-25 08:27:16 UTC
Created attachment 107368 [details] [review]
Bug 26017: Correct permission check on tools page

The 'Cashup registers' link from the tools page retained an previous
verions of the permission name. This patch corrects it to use the final
name we sebtled on and thus now correctly displays the link when
appropriate.

Test plan
1/ Enable cash registers via the 'UseCashRegisters' system preference
2/ Ensure you are logged in as a user who has the cash management
   cashup permission.
3/ Verify that the 'Cashup registers' option appears on the tools page.

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2020-07-25 08:27:32 UTC
Added the test plan to the commit message.
Comment 7 Jonathan Druart 2020-07-27 15:24:11 UTC
There is no flagsrequired passed to get_template_and_user in pos/registers.pl. That sounds wrong, can you have a look?
Comment 8 Martin Renvoize 2020-08-04 13:55:14 UTC
(In reply to Jonathan Druart from comment #7)
> There is no flagsrequired passed to get_template_and_user in
> pos/registers.pl. That sounds wrong, can you have a look?

See bug 26023. The page should display without a specific cashup permission; bug 26017 adds the proper permissions check to the submission.
Comment 9 Martin Renvoize 2020-08-04 14:07:51 UTC
Created attachment 107765 [details] [review]
Bug 26017: Correct permission check on tools page

The 'Cashup registers' link from the tools page retained an previous
verions of the permission name. This patch corrects it to use the final
name we sebtled on and thus now correctly displays the link when
appropriate.

Test plan
1/ Enable cash registers via the 'UseCashRegisters' system preference
2/ Ensure you are logged in as a user who has the cash management
   cashup permission.
3/ Verify that the 'Cashup registers' option appears on the tools page.

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Martin Renvoize 2020-08-04 14:07:55 UTC
Created attachment 107766 [details] [review]
Bug 26017: (follow-up) Serverside permission check on registers page

This patch adds a serverside permissions check for the display of the
registers summary page.
Comment 11 Martin Renvoize 2020-08-04 14:08:40 UTC
On second thoughts.. we can catch the same permissions as we do in the followup bug here.. 's' vs ''.

Followup attached.
Comment 12 Jonathan Druart 2020-08-06 09:38:14 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 13 Lucas Gass 2020-08-14 21:01:18 UTC
backported to 20.05.x for 20.05.03
Comment 14 Aleisha Amohia 2020-08-16 22:22:23 UTC
In 19.11.x, this bug exists on the Administration home page instead of in Tools. Probably want to open a new bug report specifically for 19.11.x to fix this.

not backporting this one to 19.11.x