https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41550 --- Comment #19 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 212720 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212720&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 Every entry has a diff: CREATE and grants or added permissions show the values as added, DELETE and revokes or removed permissions show them as removed, and MODIFY shows the old and new values. 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. ktd --shell 2. prove t/db_dependent/Koha/AccessControl/Roles.t t/db_dependent/Koha/AccessControl/Grants.t Result: all tests pass. They check every log entry above, its diff, and that nothing is logged for patrons with BorrowersLog off 3. To check the logs in the staff interface, also apply bug 44277: it adds the pages to manage roles and grant them, and shows these entries in the Log viewer. Its patch "Show role changes and grants in the log viewer" has the steps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.