Bug 26017

Summary: Cashup registers never shows on tools page
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: ToolsAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: aleisha, black23, jonathan.druart, lucas, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.03
Circulation function:
Bug Depends on:    
Bug Blocks: 25764, 26023    
Attachments: Bug 26017: Correct permission check on tools page
Bug 26017: Correct permission check on tools page
Bug 26017: Correct permission check on tools page
Bug 26017: Correct permission check on tools page
Bug 26017: (follow-up) Serverside permission check on registers page

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 (ashimema) 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 (ashimema) 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 (ashimema) 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 (ashimema) 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 (ashimema) 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 (ashimema) 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 (lukeg) 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