https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44235 --- Comment #1 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 212438 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212438&action=edit Bug 44235: Prompt to add sip_client permission to SIP2 account patrons Since bug 43106, SIP2 clients need the sip_client permission to log in. This warns staff when the patron linked to a SIP2 account lacks it and offers to add it: - After creating or editing an account, and when viewing one, a dialog says the patron lacks sip_client and offers an "Add permission" button. Staff who can't set permissions get a warning instead, as do staff without staffaccess when the patron is in a staff category. - The SIP2 accounts API gets has_sip_client_permission and patron_is_staff embeds (null when no patron matches login_id) - New endpoint POST /api/v1/sip2/accounts/{sip_account_id}/sip_client_permission grants sip_client to the account's patron, keeping their other permissions. It requires manage_sip2 and permissions, and follows members/member-flags.pl: the patron must be visible to the user, and staff patrons need staffaccess. Test plan: 1. Apply bug 43106 and this patch, run updatedatabase, yarn build, restart_all 2. Pick a patron without sip_client (and not a superlibrarian) 3. Administration > SIP2 > Accounts > New account, use that patron as the staff userid, save 4. Confirm a "Missing sip_client permission" dialog appears 5. Click "Not now", confirm the dialog closes and the patron's permissions are unchanged 6. Reload the account page, confirm the dialog appears again 7. Click "Add permission", confirm the success message and that the patron now has sip_client on their set permissions page, with their other permissions kept 8. Reload the account page, confirm no dialog appears 9. Remove sip_client from the patron, then log in as a staff user with manage_sip2 but not the permissions permission. View the account and confirm you get a warning without an "Add permission" button 10. Move the patron to a staff category (category type Staff). Log in as a staff user with manage_sip2 and permissions but not staffaccess. View the account and confirm you get a warning that the patron is a staff member, without an "Add permission" button 11. Give that user staffaccess, view the account again, confirm the "Add permission" button is offered and works 12. prove t/db_dependent/Koha/SIP2/Accounts.t t/db_dependent/api/v1/sip2_accounts.t 13. yarn cypress run --spec t/cypress/integration/SIP2/Accounts.ts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.