| Summary: | Patrons subpermissions should be fetched with borrowernumber instead of userid | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Emmi Takkinen <emmi.takkinen> |
| Component: | Authentication | Assignee: | Emmi Takkinen <emmi.takkinen> |
| Status: | Signed Off --- | QA Contact: | Testopia <testopia> |
| Severity: | trivial | ||
| Priority: | P5 - low | CC: | david, dpavlin |
| Version: | Main | Keywords: | release-notes-needed |
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | --- |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
| Attachments: |
Bug 41269: Use borrowernumber to fetch patrons subpermissions
Bug 41269: Use borrowernumber to fetch patrons subpermissions |
||
|
Description
Emmi Takkinen
2025-11-19 09:12:19 UTC
Created attachment 190103 [details] [review] Bug 41269: Use borrowernumber to fetch patrons subpermissions Koha currently fetches patrons subpermissions with userid in method get_user_subpermissions. If for some reason patron doesn't have userid their subpermissions aren't displayed on Koha UI. Althougt this shouldn't really happen (unless there are some local use cases where userid can be empty), this method is only used to either display patrons subpermissions on page Set permissions or to check if SCO user only has SCO permissions. In both of these cases we can use patrons borrowernumber instead of userid since they check existing patrons permissions, not the ones for patron who is about to log into Koha. To test: 1. Apply this patch. 2. Enable sysprefs WebBasedSelfCheck and AutoSelfCheckAllowed and add some patrons userid to AutoSelfCheckID. 3. Make sure patron whose userid you used doesn't have permissions to use SCO and has other subpermissions instead. 4. Navigate to page About Koha>System infromation. => Confirm that warnings starting with "The patron used for the self-checkout..." are displayed. 5. Check patrons permissions. => Confirm that patrons subpermissions are displayed normally. Sponsored-by: Koha-Suomi Oy Created attachment 190875 [details] [review] Bug 41269: Use borrowernumber to fetch patrons subpermissions Koha currently fetches patrons subpermissions with userid in method get_user_subpermissions. If for some reason patron doesn't have userid their subpermissions aren't displayed on Koha UI. Althougt this shouldn't really happen (unless there are some local use cases where userid can be empty), this method is only used to either display patrons subpermissions on page Set permissions or to check if SCO user only has SCO permissions. In both of these cases we can use patrons borrowernumber instead of userid since they check existing patrons permissions, not the ones for patron who is about to log into Koha. To test: 1. Apply this patch. 2. Enable sysprefs WebBasedSelfCheck and AutoSelfCheckAllowed and add some patrons userid to AutoSelfCheckID. 3. Make sure patron whose userid you used doesn't have permissions to use SCO and has other subpermissions instead. 4. Navigate to page About Koha>System infromation. => Confirm that warnings starting with "The patron used for the self-checkout..." are displayed. 5. Check patrons permissions. => Confirm that patrons subpermissions are displayed normally. Sponsored-by: Koha-Suomi Oy Signed-off-by: David Nind <david@davidnind.com> |