Bug 22553

Summary: Unchecking a subpermission does not uncheck the top level permission
Product: Koha Reporter: Nick Clemens <nick>
Component: Staff interfaceAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: gmcharlt, katrin.fischer, martin.renvoize
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.05.00
Bug Depends on: 11375    
Bug Blocks:    
Attachments: Bug 22553: Unchecking a subpermission does not uncheck the top level permission
Bug 22553: Unchecking a subpermission does not uncheck the top level permission
Bug 22553: Unchecking a subpermission does not uncheck the top level permission

Description Nick Clemens 2019-03-20 19:42:24 UTC
To recreate:
1 - Edit permissions for a user
2 - Check a top level permission
3 - Uncheck some sub permissions
4 - Note the top level is still checked
5 - Save
6 - Edit the permissions agin
7 - User has top level permission
Comment 1 Katrin Fischer 2019-04-09 10:43:44 UTC
Just ran into this as well - It's dangerous as it could go unnoticed easily and having to uncheck the top permission means you have to set all sub-permissions again, which is error-prone.
Comment 2 Owen Leonard 2019-04-09 13:28:00 UTC
Created attachment 87606 [details] [review]
Bug 22553: Unchecking a subpermission does not uncheck the top level permission

This patch makes a minor change to the set permissions page's JavaScript
so that unchecking a subpermission will uncheck the top level
permission.

To test, apply the patch and open the "Set permissions" page for a
patron.

 - Expand a permission with multiple subpermissions.
 - Check the top level permission. All subpermissions should be checked.
 - Uncheck one of the subpermissions. The top level permission should
   now be unchecked.
Comment 3 Liz Rea 2019-04-09 13:53:55 UTC
Created attachment 87607 [details] [review]
Bug 22553: Unchecking a subpermission does not uncheck the top level permission

This patch makes a minor change to the set permissions page's JavaScript
so that unchecking a subpermission will uncheck the top level
permission.

To test, apply the patch and open the "Set permissions" page for a
patron.

 - Expand a permission with multiple subpermissions.
 - Check the top level permission. All subpermissions should be checked.
 - Uncheck one of the subpermissions. The top level permission should
   now be unchecked.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 4 Katrin Fischer 2019-04-09 18:49:55 UTC
Created attachment 87670 [details] [review]
Bug 22553: Unchecking a subpermission does not uncheck the top level permission

This patch makes a minor change to the set permissions page's JavaScript
so that unchecking a subpermission will uncheck the top level
permission.

To test, apply the patch and open the "Set permissions" page for a
patron.

 - Expand a permission with multiple subpermissions.
 - Check the top level permission. All subpermissions should be checked.
 - Uncheck one of the subpermissions. The top level permission should
   now be unchecked.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Nick Clemens 2019-04-10 20:14:13 UTC
Awesome work all!

Pushed to master for 19.05
Comment 6 Martin Renvoize 2019-04-15 11:28:16 UTC
Bug in enhancement not in 18.11.x series.