Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Respect allow send as guest configuration in resolver #734

Merged
merged 4 commits into from
Jun 25, 2019

Conversation

pmclain
Copy link
Contributor

@pmclain pmclain commented Jun 8, 2019

Description (*)

Resolver throws GraphQlAuthorizationException when sending as guest if allow
send as guest is disabled.

Fixed Issues (if relevant)

  1. Guest User can SendFriend products ignoring restrictions #732

Manual testing scenarios (*)

Send a Friend Mutation:

mutation {
  sendEmailToFriend(
    input: {
      product_id: {$productId}
      sender: {
        name: "Name"
        email: "[email protected]"
        message: "Lorem Ipsum"
      }          
      recipients: [{
        name: "Recipient Name 1"
        email:"[email protected]"
      }]
    }
  ) {
    sender {
      name
      email
      message
    }
    recipients {
      name
      email
    }
  }
}
  1. Vanilla Magento install. Default value for Stores > Configuration > Catalog > Email a Friend > Allow For Guests is No
  2. Execute above mutation as guest.
  3. Validate GraphQlAuthorizationException
  4. Authenticate as customer
  5. Execute mutation including authentication token
  6. Validate success response
  7. Set Allow for Guests to Yes
  8. Repeat items 2-6. Guest mutation should no longer return GraphQlAuthorizationException

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Resolver throws `GraphQlAuthorizationException` when sending as guest if allow
send as guest is disabled.

Fixes magento#732
* Missing dep on magento/module-authorization
* Separate email send logic from resolver
@ghost
Copy link

ghost commented Jun 25, 2019

Hi @pmclain, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

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

Successfully merging this pull request may close these issues.

3 participants