[Bug 34460] New: Patron category should regulate if account can have permissions
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 Bug ID: 34460 Summary: Patron category should regulate if account can have permissions Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: cbrannon@cdalibrary.org QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Permission management would be simpler if there were a setting in patron categories that indicate whether that category of patron can have permissions. - If no, that option would not appear in the patron menu. - If patron category is changed to a category that does not allow permissions, any existing permissions should be cleared when change is saved. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 --- Comment #1 from Christopher Brannon <cbrannon@cdalibrary.org> --- On further reflections, my second suggestion above should have its own preference setting to retain current behavior. - Create a pref, like ClearPermissionsAutomatically, where it defaults to Don't, but can be set to Do if you want permissions cleared automatically when changing patron to a category that doesn't allow permissions. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 Sally <sally.healey@cheshiresharedservices.gov.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sally.healey@cheshireshared | |services.gov.uk --- Comment #2 from Sally <sally.healey@cheshiresharedservices.gov.uk> --- +1 this is a great suggestion. Koha having the ability to clear permissions from an account when it moves from a 'permissions allowed category' into an ordinary patron category would be a huge help. Despite policies explaining otherwise, some staff members still believe that moving an ex-staff account to being an ordinary patron account revokes Koha access. I run a report to identify when this happens - but it would be very helpful if Koha could manage this automatically. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 Katie Bliss <kebliss@dmpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kebliss@dmpl.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 Johanna Räisä <johanna.raisa@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |johanna.raisa@koha-suomi.fi Assignee|koha-bugs@lists.koha-commun |johanna.raisa@koha-suomi.fi |ity.org | Status|NEW |ASSIGNED -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 --- Comment #3 from Johanna Räisä <johanna.raisa@koha-suomi.fi> --- I will take this. I think this helps maintaining the permissions and reduces accidents. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 --- Comment #4 from Johanna Räisä <johanna.raisa@koha-suomi.fi> --- Created attachment 198268 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198268&action=edit Bug 34460: Add can_have_permissions to patron categories This patch adds a new field to the patron categories, can_have_permissions, which allows to set whether a category can have permissions or not. A system preference ClearPermissionsAutomatically is added to automatically clear permissions if a category is updated. Test plan: 1. Add a new patron category with can_have_permissions set to false and verify that it cannot have permissions. 2. Add a new patron with the category created in step 1 and verify that it cannot have permissions. 3. Update the category created in step 1 to set can_have_permissions to true and verify that it can have permissions. 4. Add permissions to the patron created in step 2 and verify that they are added successfully. 5. Enable the ClearPermissionsAutomatically system preference. 6. Update the patron's category to a different category which has can_have_permissions set to false. 7. Change the patron's category back to the original category and verify that the permissions are cleared. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 Johanna Räisä <johanna.raisa@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 Johanna Räisä <johanna.raisa@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Sponsorship status|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Comma delimited| |Koha-Suomi Oy list of Sponsors| | Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #198268|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 --- Comment #5 from David Nind <david@davidnind.com> --- Created attachment 198329 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198329&action=edit Bug 34460: Add can_have_permissions to patron categories This patch adds a new field to the patron categories, can_have_permissions, which allows to set whether a category can have permissions or not. A system preference ClearPermissionsAutomatically is added to automatically clear permissions if a category is updated. Test plan: 1. Add a new patron category with can_have_permissions set to false and verify that it cannot have permissions. 2. Add a new patron with the category created in step 1 and verify that it cannot have permissions. 3. Update the category created in step 1 to set can_have_permissions to true and verify that it can have permissions. 4. Add permissions to the patron created in step 2 and verify that they are added successfully. 5. Enable the ClearPermissionsAutomatically system preference. 6. Update the patron's category to a different category which has can_have_permissions set to false. 7. Change the patron's category back to the original category and verify that the permissions are cleared. Sponsored-by: Koha-Suomi Oy Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #6 from David Nind <david@davidnind.com> --- Testing notes (using KTD): 1. Apply the patch. 2. Update the database: updatedatabase 3. Restart everything: restart_all Using Henry - only changing the patron category "Set permissions" setting: 1. Change user name and password so can log in as them 2. Set permissions: - Staff access, allows viewing of catalogue in staff interface (catalogue) - Manage Koha system settings (Administration panel) (parameters) 3. Change Henry from "Staff" to "Patron" category 4. "Set permissions" is greyed out 5. Can still log in to the staff interface 6. Change the "Patron" category so that "Set permissions" is set to "Yes" 7 "Set permissions" no longer greyed out (after refreshing Henry's details page) Using Henry - using the new ClearPermissionsAutomatically system preference: 1. Set ClearPermissionsAutomatically = "Enable" 2. Change "Set permissions" for the "Patron" category to "No" 3. "Set permissions" is greyed out for Henry 4. Henry can still log in to the staff interface 5. Change the "Patron" category so that it doesn't have permissions 6. "Set permissions" for Henry is greyed out 7. Change Henry's category to the "Staff" category 8. Permissions from previously remain the same and can still log in to the staff interface 9. Change Henry's category to the "Patron" category 10. Refresh Henry's details page - "Set permissions" greyed out 11. Henry can no longer log in to the staff interface 12. Change Henry's category back to the "Staff" category. 13. Henry can't log in to the staff interface 14. Refresh Henry's details page - "Set permissions" available 15. Click "Set permissions" - no permissions are set, so permissions were cleared Notes: 1. New field added to patron categories: Can have permissions: [Yes|No] (With a hint: Determine if patrons in this category can have permissions assigned.) 2. Set to "No" by default for new patron categories 3. If a patron's category is changed from one with permissions to one with no permissions, the "Set permissions" setting for the patron's account is greyed out 4. Their permissions are not cleared, and they can still do what they did before (log in to the staff interface, and so on) 5. If the new ClearPermissionsAutomatically system preference is set to "Enable", then changing the patron's category from one with permissions to no permissions, clears any existing permissions they may have Observation 1 ============= Wording for the new ClearPermissionsAutomatically system preference: [Enable/Don't enable] the ability for staff permissions to be automatically cleared when a staff member's category is changed to one that does not have permissions. Suggested changes: [Enable/Don't enable] automatically removing permissions for patrons when their patron category is changed, and that patron category has the "Can have permissions" setting set to "No". Observation 2 ============= When the "Can have permissions" setting is changed for a patron category, the success alert at the top of the page is "Patron category updated successfully." If the ClearPermissionsAutomatically system preference is enabled and the setting for "Can have permissions" is changed from "Yes" to "No", should there be an additional message along the lines: Any patrons that are changed to this category from a patron category that has permissions, will have their permissions removed. Observation 3 ============= A bug currently waiting for QA has some settings and improvements to messages when changing a patron's category, so that there aren't "silent" changes: Bug 42112 - Add option when changing a patron's category: allow choosing what to do for the expiry date and messaging preferences Should this change be added as a pop-up message there as well when ClearPermissionsAutomatically is enabled? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=42112 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 Johanna Räisä <johanna.raisa@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #198329|0 |1 is obsolete| | --- Comment #7 from Johanna Räisä <johanna.raisa@koha-suomi.fi> --- Created attachment 210081 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210081&action=edit Bug 34460: Add can_have_permissions to patron categories This patch adds a new field to the patron categories, can_have_permissions, which allows to set whether a category can have permissions or not. A system preference ClearPermissionsAutomatically is added to automatically clear permissions if a category is updated. Test plan: 1. Create a new patron category with "Can have permissions" set to No. 2. Add a new patron in that category and verify the "Set permissions" link is greyed out. 3. Update the category created in step 1 to set "Can have permissions" to Yes and verify that it can have permissions. 4. Add permissions to the patron created in step 2 and verify that they are added successfully. 5. Enable the ClearPermissionsAutomatically system preference. 6. Change the patron's category to one that cannot have permissions and verify that the "Set permissions" link is greyed out and, with the preference enabled, the patron's permissions are cleared. 7. Change the patron's category back to one that can have permissions and verify that permissions can be set again. 8. In the patron category list, verify the "Can have permissions" column is displayed and reflects each category's setting. 9. With ClearPermissionsAutomatically enabled, change a patron's category from one that can have permissions to one that cannot, and verify that the "Patron category changed" modal shows a warning that permissions will be removed on save. Sponsored-by: Koha-Suomi Oy Assisted-by: opencode-go/beam-free -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 Johanna Räisä <johanna.raisa@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210081|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 --- Comment #8 from David Nind <david@davidnind.com> --- Created attachment 210804 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210804&action=edit Bug 34460: Add can_have_permissions to patron categories This patch adds a new field to the patron categories, can_have_permissions, which allows to set whether a category can have permissions or not. A system preference ClearPermissionsAutomatically is added to automatically clear permissions if a category is updated. Test plan: 1. Create a new patron category with "Can have permissions" set to No. 2. Add a new patron in that category and verify the "Set permissions" link is greyed out. 3. Update the category created in step 1 to set "Can have permissions" to Yes and verify that it can have permissions. 4. Add permissions to the patron created in step 2 and verify that they are added successfully. 5. Enable the ClearPermissionsAutomatically system preference. 6. Change the patron's category to one that cannot have permissions and verify that the "Set permissions" link is greyed out and, with the preference enabled, the patron's permissions are cleared. 7. Change the patron's category back to one that can have permissions and verify that permissions can be set again. 8. In the patron category list, verify the "Can have permissions" column is displayed and reflects each category's setting. 9. With ClearPermissionsAutomatically enabled, change a patron's category from one that can have permissions to one that cannot, and verify that the "Patron category changed" modal shows a warning that permissions will be removed on save. Sponsored-by: Koha-Suomi Oy Assisted-by: opencode-go/beam-free Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This enhancement adds a release notes| |"Can have permissions" | |field to patron categories. | |This determines if patrons | |in this category can have | |permissions assigned. | | | |Where this field is set to | |"No", the "More > Set | |permissions" option for a | |patron's account is greyed | |out. | | | |Note: Any existing | |permissions for a patron | |are not cleared (unless the | |new | |ClearPermissionsAutomatical | |ly system preference is set | |to "Enable"), and they can | |still do what they did | |before (log in to the staff | |interface, and so on. | | | |If a patron's category is | |changed to a category | |without permissions and the | |ClearPermissionsAutomatical | |ly system preference is set | |to "Enable", then: | |- there is a confirmation | |pop-up window with a | |message that any | |permissions will be removed | |- clears any existing | |permissions they may have | |once "Confirm" is clicked -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |andrew@bywatersolutions.com --- Comment #9 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Your atomicupdate sets "Can have permissions" to No for any category that is not type Staff. That will be quite disruptive for many libraries. It should set "Can have permissions" to Yes for all categories at upgrade, allowing libraries to set it to No as desired. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 --- Comment #10 from Christopher Brannon <cbrannon@cdalibrary.org> --- Good catch Andrew! That would be messy. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 --- Comment #11 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Overall, this code does not stop a patron from *having* permissions. It only stops a user from seeing, adding, or removing the patron's permissions. If ClearPermissionsAutomatically is set to "Don't enable," once a patron with permissions is moved to a category with Can Have Permissions set to No, that patron's permissions cannot be seen or changed but are still in effect. This would certainly lead to confusion. Additionally, this code doesn't do anything to stop permissions from being added to patron accounts via methods other than the Set Permissions page. Many libraries use ByWaters Batch Permissions Modifier plugin: https://github.com/bywatersolutions/koha-plugin-batch-permissions-modifier. The plugin is able to add permissions to any patron, regardless of the Can Have Permissions value of their category. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34460 --- Comment #12 from Christopher Brannon <cbrannon@cdalibrary.org> --- (In reply to Andrew Fuerste-Henry from comment #11)
Overall, this code does not stop a patron from *having* permissions. It only stops a user from seeing, adding, or removing the patron's permissions.
If ClearPermissionsAutomatically is set to "Don't enable," once a patron with permissions is moved to a category with Can Have Permissions set to No, that patron's permissions cannot be seen or changed but are still in effect. This would certainly lead to confusion.
Additionally, this code doesn't do anything to stop permissions from being added to patron accounts via methods other than the Set Permissions page. Many libraries use ByWaters Batch Permissions Modifier plugin: https://github.com/bywatersolutions/koha-plugin-batch-permissions-modifier. The plugin is able to add permissions to any patron, regardless of the Can Have Permissions value of their category.
Ah, well that is good, regarding it not removing existing permissions, but if "Can have permissions" changes normal behavior, then it stands to reason that it shouldn't be done. New features are supposed to preserve behavior prior to the upgrade, so if it is changing something out of the norm, even if it doesn't cripple access, it still is against common practice. And on the topic of the batch permissions modifier, I am not sure what good this is if that plugin is just an easy backdoor. If we are going to lock things down, we shouldn't have a way to get around it like that. Thoughts? -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org