dev/core#1751: [Create Email] Only Show Update/Save Template when User has Permission to Edit Templates
Created by: tunbola
In the email modal, CiviCRM users can write an email from scratch or use an existing message template. They are given the options to update existing templates or save a new template.
These options are currently available and can be completed by users with basic access to CiviCRM, even when they do not have the permission CiviCRM: edit message templates.
Organisations want to create standard message templates that cannot be altered by the hundreds of staff using the templates. They need to be able to set this up as a user permission.
A Civicrm user without access to the CiviCRM: edit message templates permission can update existing templates or save a new template when sending an email via the email activity form.
The CiviCRM: edit message templates permission is needed to update existing templates or save a new template when sending an email via the email activity form.
The permission check for
edit message templates was added in the EmailCommon Template before displaying the
Update Template and
Save as New Template checkboxes.
After making this change, there were some errors in the console regarding these two fields for the case where the user does not have the
edit message templates permission, some checks were added in these functions for the existent of these fields before the logic were executed.