https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41550 --- Comment #13 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 212702 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212702&action=edit Bug 41550: (follow-up) Log changes to roles and to patrons' grants Changing which roles exist, what they hold, or who holds them changes what staff may do, so it is written to the action logs. Roles (module ACCESS_CONTROL, object the role id), always logged, with no system preference to turn it off, since a change reaches everyone holding the role: - CREATE, MODIFY (with the changed values in the diff) and DELETE - ADD_PERMISSION and REMOVE_PERMISSION, with the role code and the permission (resource:action:scope) Grants to a patron (module MEMBERS, object the borrowernumber), when BorrowersLog is on, like other changes to a patron's permissions: - GRANT_ROLE and REVOKE_ROLE, with the role and the library the grant is limited to - GRANT_PERMISSION and REVOKE_PERMISSION, with the permission and library The logging is in the classes, so the staff interface, the REST API and scripts all log the same way, including deleting a set of grants. Deleting a role revokes it from its holders first, so each revoke is logged instead of disappearing with the role. Test plan: 1. prove t/db_dependent/Koha/AccessControl/Roles.t t/db_dependent/Koha/AccessControl/Grants.t 2. In a perl shell (or with bug 44277's staff pages), create a role, rename it, add and remove a permission, then delete it 3. Tools > Log viewer, module ACCESS_CONTROL: one entry for each change 4. Turn on BorrowersLog, grant the role to a staff member and revoke it: the Log viewer shows GRANT_ROLE and REVOKE_ROLE under Patrons for that staff member. With BorrowersLog off, nothing is logged for them 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.