Bugzilla – Attachment 195241 Details for
Bug 42083
Email and SMS messages from patron record should have distinct permissions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 42083: Implement distinct permissions
Bug-42083-Implement-distinct-permissions.patch (text/plain), 3.96 KB, created by
Andrew Fuerste-Henry
on 2026-03-12 23:07:49 UTC
(
hide
)
Description:
Bug 42083: Implement distinct permissions
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2026-03-12 23:07:49 UTC
Size:
3.96 KB
patch
obsolete
>From 8b377c96f9d930f7a62f9091b787bbfb230a1d6a Mon Sep 17 00:00:00 2001 >From: Andrew Fuerste Henry <andrew@bywatersolutions.com> >Date: Thu, 12 Mar 2026 23:00:27 +0000 >Subject: [PATCH] Bug 42083: Implement distinct permissions > >To test: >1 - have an staff account with 'send_messages_to_borrowers' permission but not top level 'borrowers' permission >2 - have a value in SMSSendDriver system preference >3 - log in under your staff account and confirm you can send both email and SMS messages from the Add Message button on a patron record > >4 - apply patch, updatedatabase, restart_all > >5 - confirm your staff account now has 'send_messages_to_borrowers_email' permission rather than 'send_messages_to_borrowers' >6 - confirm your staff account can now only send email messages from the Add Message button on a patron record >7 - add 'send_messages_to_borrowers_sms' permission to your staff account >8 - confirm your staff account can now send both email and sms messages from the Add Message button on a patron record >9 - remove 'send_messages_to_borrowers_email' from your staff account >10 - confirm your staff account can now only send sms messages from the Add Message button on a patron record >--- > circ/add_message.pl | 9 ++++++++- > .../intranet-tmpl/prog/en/includes/members-toolbar.inc | 8 ++++---- > 2 files changed, 12 insertions(+), 5 deletions(-) > >diff --git a/circ/add_message.pl b/circ/add_message.pl >index 33dc1d8c60d..2e872fbc57f 100755 >--- a/circ/add_message.pl >+++ b/circ/add_message.pl >@@ -66,7 +66,14 @@ if ( $op eq 'cud-edit_message' && $message_id ) { > if ( $message_type eq 'E' or $message_type eq 'SMS' ) { > my $message_transport_type = $message_type eq 'SMS' ? 'sms' : 'email'; > my $logged_in_patron = Koha::Patrons->find($loggedinuser); >- if ( !$logged_in_patron->has_permission( { borrowers => 'send_messages_to_borrowers' } ) ) { >+ if ( $message_transport_type eq 'email' >+ && !$logged_in_patron->has_permission( { borrowers => 'send_messages_to_borrowers_email' } ) ) >+ { >+ C4::Output::output_and_exit( $input, $cookie, $template, 'insufficient_permission' ); >+ } >+ if ( $message_transport_type eq 'sms' >+ && !$logged_in_patron->has_permission( { borrowers => 'send_messages_to_borrowers_sms' } ) ) >+ { > C4::Output::output_and_exit( $input, $cookie, $template, 'insufficient_permission' ); > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >index 51f26cb47a3..c7389c9ae1b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >@@ -186,11 +186,11 @@ > <select name="message_type" id="message_type" class="form-select"> > <option value="L">Staff - Internal note</option> > <option value="B">OPAC - [% patron.firstname | html %] [% patron.surname | html %]</option> >- [% IF CAN_user_borrowers_send_messages_to_borrowers %] >+ [% IF CAN_user_borrowers_send_messages_to_borrowers_email %] > <option value="E">Email - email addresses of patron</option> >- [% IF Koha.Preference("SMSSendDriver") %] >- <option value="SMS">SMS - sms number of patron</option> >- [% END %] >+ [% END %] >+ [% IF Koha.Preference("SMSSendDriver") && CAN_user_borrowers_send_messages_to_borrowers_sms %] >+ <option value="SMS">SMS - sms number of patron</option> > [% END %] > </select> > </li> >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 42083
:
195239
|
195240
| 195241 |
195242