Currently, a patron can have all permissions at once. This includes superlibrarian, even though it already includes all other permissions anyway. I propose that we introduce some JS to uncheck and disable other permissions when superlibrarian is selected. This interface behaviour will make the difference between superlibrarian and the other permissions much more obvious than it is now. I also suggest having some handling to "fix" the current situation where superlibrarian can be selected in conjunction with other permissions. This would include a pop-up warning telling the user that the permissions are going to be changed to just include superlibrarian. I think this patch is also useful in terms of integrating Koha with other external software, since this way you can count on superlibrarians always having a "1" flag in their borrower record. Currently, if superlibrarian is selected along with other permissions, the flag in the borrower record won't be 1. It'll be the sum of the superlibrarian flag and any other permissions/flags applied to that patron. If you give superlibrarians access to external software through Koha, it helps to make sure they always have that "1" flag.
Created attachment 14733 [details] [review] Bug 9439 - Enforce superlibrarian mutual exclusivity of other permissions Testing: Before applying patch: 1) Go to the "Detail" tab of a patron record 2) Click on the "More" button 3) Click on "Set Permissions" 4) Note that you can select any combination of permissions (including superlibrarian and any of the others listed). After applying patch: 1) Follow the above Steps 1-3 2) Note that checking/unchecking the superlibrarian checkbox will disable and clear/enable the other permission checkboxes. 3) If you change the permissions for a patron that already had the superlibrarian permission and a combination of others, you should see a pop-up box explaining that the superlibrarian permission is mutually exclusive of the others and that it will be now be changed.
Comment on attachment 14733 [details] [review] Bug 9439 - Enforce superlibrarian mutual exclusivity of other permissions Tested on sandbox (3.8.5): works as expected, reverts flag=261887 "all permissions" to superlibrarian flag=1 and still allows granularity for staff with partial permissions. Now incorporated into production 3.8.5.
Created attachment 14805 [details] [review] [SIGNED-OFF]Bug 9439 - Enforce superlibrarian mutual exclusivity of other permissions Basically, when you check the checkbox for the superlibrarian permission in the patron record, it will disable and uncheck all the other permission checkboxes. When you uncheck the checkbox for the superlibrarian permission, it will renable those boxes. There is also some JS code there to ensure that the other boxes are disabled when returning to the change permission screen (i.e. the patch is not just a click handler). In the event that the checkboxes for superlibrarian and other permissions are already checked, the user will be shown a pop-up window explaining that the superlibrarian permission is mutually exclusive to the others (since it already includes the others) and that the permissions for that patron will then be reset to just include the superlibrarian permission. Comment: Tested on master. Works as described. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
QA comment: Works nicely. Simple patch with some javascript lines added. Marked as Passed QA.
Created attachment 15002 [details] [review] Bug 9439 - Enforce superlibrarian mutual exclusivity of other permissions Basically, when you check the checkbox for the superlibrarian permission in the patron record, it will disable and uncheck all the other permission checkboxes. When you uncheck the checkbox for the superlibrarian permission, it will renable those boxes. There is also some JS code there to ensure that the other boxes are disabled when returning to the change permission screen (i.e. the patch is not just a click handler). In the event that the checkboxes for superlibrarian and other permissions are already checked, the user will be shown a pop-up window explaining that the superlibrarian permission is mutually exclusive to the others (since it already includes the others) and that the permissions for that patron will then be reset to just include the superlibrarian permission. Comment: Tested on master. Works as described. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
This patch has been pushed to master. I love this feature. I might have liked to see the checkboxes remain active so that clicking any checkbox other than the superlibrarian cleared the superlibrarian box, but I the way it works now is good too.