[Bug 44213] New: List account permissions on SIP account page
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44213 Bug ID: 44213 Summary: List account permissions on SIP account page Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: SIP2 Assignee: koha-bugs@lists.koha-community.org Reporter: andrew@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Target Milestone: --- When viewing a SIP account, it would be helpful to be able to see which permissions the associated user has. Maybe in a tooltip next to the userid? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44213 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |andrew@bywatersolutions.com |ity.org | Status|NEW |Needs Signoff -- 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=44213 --- Comment #1 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 212234 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212234&action=edit Bug 44213: List account permissions on SIP account page When viewing a SIP2 account it is useful to see which permissions the associated staff user has, since SIP2 transactions run with them. This patch adds: - Koha::SIP2::Account->patron_permissions, returning the permissions granted to the patron linked through login_id as a sorted list of { module, subpermissions } entries (subpermissions is null when the whole module is granted) - a 'patron_permissions' embed on GET /sip2/accounts and /sip2/accounts/{id} - a read-only "Staff user permissions" row on the SIP2 account page, directly below the staff userid. Modules granted in full are listed by their module code; where only some subpermissions of a module are granted, only those subpermission codes are listed, e.g. "circulate, edit_calendar, export_catalog", or "None" The row is not shown when login_id matches no patron. Test plan: 1. Go to Administration > SIP2 > Accounts and view an account whose login is an existing staff patron's userid 2. Apply the patch, run yarn build and restart_all 3. View the account again: a "Staff user permissions" row lists the patron's permissions 4. Give the patron a subpermission without its module (e.g. advanced_editor without editcatalogue): only "advanced_editor" is listed, not "editcatalogue" 5. Change the patron's permissions (Patrons > More > Set permissions) and reload the account page: the row reflects the change 6. Remove all of the patron's permissions: the row shows "None" 7. Edit and save the account: it still saves correctly, and the row does not appear in the edit form or the accounts list 8. prove t/db_dependent/Koha/SIP2/Accounts.t prove t/db_dependent/api/v1/sip2_accounts.t Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44213 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |44212 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44212 [Bug 44212] Link to SIP patron in SIP account -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44213 Andrew Fuerste-Henry <andrew@bywatersolutions.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=44213 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #212234|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=44213 --- Comment #2 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 212332 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212332&action=edit Bug 44213: List account permissions on SIP account page When viewing a SIP2 account it is useful to see which permissions the associated staff user has, since SIP2 transactions run with them. This patch adds: - Koha::SIP2::Account->patron_permissions, returning the permissions granted to the patron linked through login_id as a sorted list of { module, subpermissions } entries (subpermissions is null when the whole module is granted) - a 'patron_permissions' embed on GET /sip2/accounts and /sip2/accounts/{id} - a read-only "Staff user permissions" row on the SIP2 account page, directly below the staff userid. Modules granted in full are listed by their module code; where only some subpermissions of a module are granted, only those subpermission codes are listed, e.g. "circulate, edit_calendar, export_catalog", or "None" The row is not shown when login_id matches no patron. Test plan: 1. Go to Administration > SIP2 > Accounts and view an account whose login is an existing staff patron's userid 2. Apply the patch, run yarn build and restart_all 3. View the account again: a "Staff user permissions" row lists the patron's permissions 4. Give the patron a subpermission without its module (e.g. advanced_editor without editcatalogue): only "advanced_editor" is listed, not "editcatalogue" 5. Change the patron's permissions (Patrons > More > Set permissions) and reload the account page: the row reflects the change 6. Remove all of the patron's permissions: the row shows "None" 7. Edit and save the account: it still saves correctly, and the row does not appear in the edit form or the accounts list 8. prove t/db_dependent/Koha/SIP2/Accounts.t prove t/db_dependent/api/v1/sip2_accounts.t Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44213 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |RESOLVED Resolution|--- |INVALID --- Comment #3 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Apparently the only permission a SIP account needs to "circulate" (See Bug 43106). So, for example, a SIP account doesn't need any account permissions in order to take a payment. With that in mind, I don't think this is actually helpful. I will, however, file a new bug to add an alert to the SIP account page if the associated user doesn't have circulate permission. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org