-
Notifications
You must be signed in to change notification settings - Fork 462
Limit email template access by sender and receiver role #10403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hey @taslangraham, I've also assigned the issue for this work package to you. Have a look at the specification and todos above and let me know what you think. We can talk about any specific issues or questions you see in our one-on-one call on Monday. |
Currently, each Mailable class has two properties: However, in the issue, you mentioned that
Given that each Mailable can be restricted to specific groups, is it a case where we should also allow individual templates of a Mailable to be further limited to a subset of these allowed groups? For example, if a Mailable is accessible to more than one role, should an individual template of this Mailable be configurable to allow access only to a single role? |
Yes, individual templates should be assignable to sender roles. Think of a discussion template; if managers want to use that to orchestrate a workflow between author and editor, there will be a mix of templates each will use to compose messages. It will be confusing to authors if they see editor templates available for their use. |
Some clarification and a mea culpa for the ambiguous language in the initial filing: The user working in settings should be able to designate which user groups (not role IDs) email templates can be sent by and sent to. |
@Devika008 The image above shows the UI changes that I had made to the Add/Edit Email Template side modal while working on this feature. Notes/thoughts/ideas/questions:
|
Hi @taslangraham, Thank you so much for reaching out regarding this issue. Regarding the Notes/thoughts/ideas/questions:
For a better user experience, I suggest displaying the question "Mark as unrestricted" with two radio button options:
An autosuggest component won’t work well here since it’s difficult to remember all the user groups that might exist.
With the change mentioned in the first point, this issue won’t occur. We need to make this an either-or selection, rather than allowing both options to remain active at the same time—otherwise, it can become confusing for the user.
|
@ewhanson Here are the final set of PRs for this feature. Functionality and tests implementation (these include work done for #10571 and #10745):
Docs |
Awesome work @taslangraham! Feel free to squash and merge! |
* #10571 WIP: Add checks to limit email template access by usergroups * #10571 WIP: Allow admins and managers to assign user groups to email templates within a mailable * #10571 WIP: add support for unrestricted templates * #10571 Update emailTemplate schema * #10571 Update locales * #10571 Move migration into v3.6 folder * #10571 add additional access checks * #10571 Add migration to install process * #10571 Make default templates unrestricted on Context creation * #10571 Make templates assignable to all user groups * #10571 Allow restriction to be set during template installation * #10571 Update access on template deletion and template restore/reset * #10571 Remove unnecessary email form components and clean up code * #10650 Minor update to emailTemplate.json schema * #10403 Conditionally display user group options * #10745 Add tests for email access restriction feature
PRs for shared libraries and individual apps has been merged! Thanks for the review and general feedback on this one @ewhanson |
Tested and looks good. Automation is great too. Here are the test scenarios.
|
Uh oh!
There was an error while loading. Please reload this page.
It's currently possible to create new email templates for mailables in a way that helps editors create their own email-based workflows. However, all mailables are available to all users when selecting a template, which can lead to inappropriate choices.
From e.g.

Settings
>Workflow
>Emails
>Add and edit templates
>Discussion (Copyediting)
:When an assigned Copyeditor goes to create a new discussion in the Copyediting stage, their
Choose a predefined message to use
dropdown includesRequest Copyedit
, which is inappropriate.To resolve this, we should add support for mailables to be designated as appropriate for certain user groups, so that when a user sees a list of possible email templates, they are only given a list that's relevant or appropriate to them. It should be possible to designate user groups when creating/editing an email template within a mailable. This should only be available on certain mailables, as not all will be related to submission workflow.
Update 2024-10-25: Specification
(from @ewhanson)
Initial steps should be to identify which roles should have access to which mailable templates as well as identifying all mailables across all applications and first-party plugins (if any). From an initial assessment of the feature, it doesn't seem like any new UI elements/pages will be necessary, but an additional todo for that work should be added if it's deemed necessary. Any mailables that roles do not have access to should not show up when creating new templates.
Note: Each todo below should be tracked as separate issues. This issue should only be closed once this work package has been finished entirely.
TODOs
The text was updated successfully, but these errors were encountered: