Bug 22553 - Unchecking a subpermission does not uncheck the top level permission
Summary: Unchecking a subpermission does not uncheck the top level permission
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff Client (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Target Milestone: ---
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 11375
Blocks:
  Show dependency treegraph
 
Reported: 2019-03-20 19:42 UTC by Nick Clemens
Modified: 2019-04-15 11:28 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.05.00


Attachments
Bug 22553: Unchecking a subpermission does not uncheck the top level permission (2.35 KB, patch)
2019-04-09 13:28 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 22553: Unchecking a subpermission does not uncheck the top level permission (2.40 KB, patch)
2019-04-09 13:53 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 22553: Unchecking a subpermission does not uncheck the top level permission (2.46 KB, patch)
2019-04-09 18:49 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.