Skip to content
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

Tp1 1760 wagtail permissions update #13523

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

dlopezvsr
Copy link
Collaborator

@dlopezvsr dlopezvsr commented Feb 23, 2025

Description

This PR introduces the setup on settings.py to allow Wagtail to send email notifications when user requires publishing approval from admins or Strat Comms. To achive this, we will require mostly manual changes on Wagtail CMS, but also it was needed to introduced the corresponding env variables for email service backend such as WAGTAILADMIN_NOTIFICATION_FROM_EMAIL.

Code changes:

  • Settings file was updated adding email backend configuration.
  • ENV variables were added including WAGTAILADMIN_NOTIFICATION_FROM_EMAIL and EMAIL_BACKEND

Manual changes required:

  • "Admin publishing approval" workflow created inside Wagtail CMS.
  • "Publishing approval" task created and attached to previous workflow.
  • Removal of publishing permissions to all other created groups to avoid overlapping permissions.
  • Update previous “no publishing group” for: "access/content editor: publishing approval group". Being this, the only group that can publish or approve (additionally to admins).
  • Add Strat Comms team to this new group (admins can remain the same).

Link to sample test page: https://foundation-s-tp1-1760-w-sg1smu.herokuapp.com/en/
Related PRs/issues: https://mozilla-hub.atlassian.net/browse/TP1-1760

Test steps

  • Log into the Review App CMS with Admin User > go to settings > find Admin user > add your email > save.
  • Logout and access the CMS again this time using the following credentials > User: editor | Pasword: editor-user-test
  • Go to pages > Homepage > Add child page > try adding a Article Page.
  • When publishing, you should only see "submit for moderation" option.
  • Fill the required fields, and click "submit for moderation".
  • You should receive a notification via email.
  • Logout and access with Admin User. You should see on the CMS panel the page pending of approval.

┆Issue is synchronized with this Jira Story

@dlopezvsr dlopezvsr self-assigned this Feb 23, 2025
@dlopezvsr dlopezvsr temporarily deployed to foundation-s-tp1-1760-w-kil6xl February 24, 2025 17:57 Inactive
@dlopezvsr dlopezvsr temporarily deployed to foundation-s-tp1-1760-w-sg1smu February 26, 2025 19:04 Inactive
@dlopezvsr dlopezvsr marked this pull request as ready for review February 26, 2025 19:36
Copy link
Collaborator

@robdivincenzo robdivincenzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @dlopezvsr,

I'm receiving a 500 error upon article creation. Is this because we don't have the gmail credentials yet?

SMTPAuthenticationError at /cms/pages/add/wagtailpages/articlepage/3/

(535, b'5.7.8 Username and Password not accepted. For more information, go to\n5.7.8  https://support.google.com/mail/?p=BadCredentials d75a77b69052e-474691a1f78sm1494131cf.14 - gsmtp')

@dlopezvsr
Copy link
Collaborator Author

dlopezvsr commented Mar 3, 2025

Hey @dlopezvsr,

I'm receiving a 500 error upon article creation. Is this because we don't have the gmail credentials yet?

SMTPAuthenticationError at /cms/pages/add/wagtailpages/articlepage/3/

(535, b'5.7.8 Username and Password not accepted. For more information, go to\n5.7.8  https://support.google.com/mail/?p=BadCredentials d75a77b69052e-474691a1f78sm1494131cf.14 - gsmtp')

That's correct @robdivincenzo, as we are still waiting for email access to create the Password App that will allow us to send the emails, for now the environment variables have generic values that are invalid for SMTPAuthentication. But as soon as I get the credentials I will add them. Thanks for reviewing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants