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

Non-admin user unable to define email recipients #1103

Closed
3 tasks
brynwhyman opened this issue Sep 5, 2021 · 2 comments
Closed
3 tasks

Non-admin user unable to define email recipients #1103

brynwhyman opened this issue Sep 5, 2021 · 2 comments

Comments

@brynwhyman
Copy link

brynwhyman commented Sep 5, 2021

Overview

Only a user with the permission "Full administrator access" is able to set email recipients. For users who have enough permissions to 'Access to Pages; Access to Files; View any page; Edit any page; View draft content' are presented with a 403 when trying to perform this action.

Steps to recreate

  1. Have a CMS user with all permissions, except "Full administrator access"
  2. Create a have a user defined form page (or block)
  3. Attempt to add an email recipient
  4. Expected result: An email recipient is saved
  5. Actual result: The CMS presents an error modal and the console reports a 403 error.

Acceptance criteria

  • All the "can" method on the UserFormRecipient DataObject reference the methods on the parent UserForm.
    • CanDelete, CanCreate and CanEdit on UserFormRecipient are mapped to CanEdit on the UserForm
  • This works both for UserFormPage and UserForm Elemental Block.

PRs

@GuySartorelli
Copy link
Member

Cannot reproduce with a userforms page - but I do get this issue with a userforms block.

@GuySartorelli
Copy link
Member

GuySartorelli commented May 2, 2022

This is being caused by getFormParent() trying to use the polymorphic relation to identify which form it's attached to, but while FormID has been set, FormClass has not, so it doesn't know which class to use for the DB query to get the form.
I find it strange that the ID would be set but not the class - I will see if I can track down where that's happening, as really if either is being set they both should.

Note that getFormParent() is also used for generating various fields in the form, so even an admin creating a new recipient will see less fields available for a new recipient in an elemental userform (though the fields do appear once the record is created).

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

No branches or pull requests

4 participants