Bug 9439 - Enforce superlibrarian mutual exclusivity of other permissions
Summary: Enforce superlibrarian mutual exclusivity of other permissions
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: David Cook
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-22 00:40 UTC by David Cook
Modified: 2014-05-26 21:04 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 9439 - Enforce superlibrarian mutual exclusivity of other permissions (3.06 KB, patch)
2013-01-22 00:57 UTC, David Cook
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 9439 - Enforce superlibrarian mutual exclusivity of other permissions (3.08 KB, patch)
2013-01-24 01:36 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 9439 - Enforce superlibrarian mutual exclusivity of other permissions (3.13 KB, patch)
2013-02-01 13:10 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2013-01-22 00:40:13 UTC
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.
Comment 1 David Cook 2013-01-22 00:57:35 UTC Comment hidden (obsolete)
Comment 2 Paul A 2013-01-24 00:12:27 UTC
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.
Comment 3 Bernardo Gonzalez Kriegel 2013-01-24 01:36:09 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2013-02-01 13:10:26 UTC
QA comment:

Works nicely.
Simple patch with some javascript lines added.

Marked as Passed QA.
Comment 5 Jonathan Druart 2013-02-01 13:10:42 UTC
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>
Comment 6 Jared Camins-Esakov 2013-02-01 16:36:12 UTC
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.