https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42085 --- Comment #19 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 197528 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197528&action=edit Bug 42085: Add Koha::Patron::set_permissions method This new method moves the permissions write logic out of the CGI controller and into Koha::Patron, making it testable and reusable. Behaviour: - Accepts a hashref of granted permissions only (matches the non-zero subset of permissions() return value) - Computes the borrowers.flags bitmask from the userflags table - Replaces user_permissions rows atomically inside a txn_do block - Applies a session-aware superlibrarian guard when ProtectSuperlibrarianPrivileges is enabled - Logs a MEMBERS/MODIFY action when permissions change and BorrowersLog is enabled, diffing before/after states Tests added to t/db_dependent/Koha/Patrons.t. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.