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

Relations for the email_preview permissions are not added during migration #11841

Closed
allouis opened this issue May 26, 2020 · 1 comment · Fixed by #11860
Closed

Relations for the email_preview permissions are not added during migration #11841

allouis opened this issue May 26, 2020 · 1 comment · Fixed by #11860
Assignees
Labels
bug [triage] something behaving unexpectedly

Comments

@allouis
Copy link
Contributor

allouis commented May 26, 2020

Issue Summary

When upgrading from Ghost 3.0 or lower, the permissions for testing newsletter emails are not correct, and only work for the Owner user.

To Reproduce

  1. Create Ghost site on version 3.0
  2. Update it to the latest
  3. Log into the /ghost as an Administrator or Editor
  4. Try to send test newsletter email from post publishing menu

Technical details:

The issue is that the migration here does not add the relation of the permissions to roles, just the permissions.

  • Ghost Version: >3.1 if migrated to from <3.1
  • Node Version: any
  • Browser/OS: any
  • Database: any
@allouis allouis added bug [triage] something behaving unexpectedly permissions labels May 26, 2020
@allouis
Copy link
Contributor Author

allouis commented May 26, 2020

SELECT
  roles.name,
  permissions.object_type,
  permissions.action_type
FROM
  roles,
  permissions,
  permissions_roles
WHERE
  roles.id = permissions_roles.role_id
AND
  permissions.id = permissions_roles.permission_id
AND
  permissions.object_type = 'email_preview';

Useful snippet to check if the migration has worked correctly

rishabhgrg added a commit to rishabhgrg/Ghost-Admin that referenced this issue May 28, 2020
refs TryGhost/Ghost#11841

- Allows editors to see email customization option for sending test newsletters
- Editors had the necessary permission fixtures but the UI was previously only available to owners or administrators
rishabhgrg added a commit to TryGhost/Admin that referenced this issue May 28, 2020
refs TryGhost/Ghost#11841

- Allows editors to see email customization option for sending test newsletters
- Editors had the necessary permission fixtures but the UI was previously only available to owners or administrators
@ErisDS ErisDS added the members label May 28, 2020
rishabhgrg added a commit to rishabhgrg/Ghost that referenced this issue Jun 2, 2020
closes TryGhost#11841

- Migration adds mapping between permissions and roles for email_preview send test mail
- Only owner previously had correct permission to send test emails
- Fixture existed to allow Admin/Editor/Integrations to send test mails but had missing migration
- Adds tests for roles to send test email
rishabhgrg added a commit that referenced this issue Jun 2, 2020
closes #11841

- Migration adds mapping between permissions and roles for email_preview send test mail
- Only owner previously had correct permission to send test emails
- Fixture existed to allow Admin/Editor/Integrations to send test mails but had missing migration
- Adds tests for roles to send test email
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [triage] something behaving unexpectedly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants