Skip to content

Custom role backend user cannot place an admin order using Braintree payment #13478

@goivvy

Description

@goivvy

Preconditions

  1. Magento 2.2.2

Steps to reproduce

  1. In backend create a custom role RoleX with limited access. Make sure you choose all Sales permissions.
  2. Create a backend user UserX and assign it to RoleX.
  3. Enable Braintree credit card payment.
  4. Login to backend as UserX and try to place an admin order using Braintree payment.

Expected result

  1. An admin order is created.

Actual result

  1. You cannot add credit card details, it is inactive.
  2. Request to admin/braintree/payment/getClientToken returns 403.

It happens because vendor/magento/module-braintree/Controller/Adminhtml/Payment/GetClientToken.php references ADMIN_RESOURCE = 'Magento_Braintree::get_client_token' but that resource is not defined in vendor/magento/module-braintree/etc/acl.xml.

Adding it to acl.xml:

and then setting it for RoleX solves the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions