After #1549334: Add UID to payment methods gets in, we should add permissions that allow users to edit and delete their own or all payment methods.

Comments

xano’s picture

Title: Add "edit/delete own payment methods" permissions » Extend and test payment method permissions
Assigned: Unassigned » xano
Status: Active » Needs review
StatusFileSize
new29.51 KB

This patch adds more detailed payment method permissions:
- Update any payment method
- Update own payment method
- Delete any payment method
- Delete own payment methods
- View any payment method
- Create %controller_title payment methods

"View any payment method" is used for the payment method overview view and when cloning a payment method that is not yours (because when you clone a payment method you see it's configuration which may be confidential).

The patch comes with tests for the new function payment_method_access(), which handles all payment method permissions, and the payment method admnistration interface. There's one fail when testing locally. Something seems off with the payment method view output.

Status: Needs review » Needs work

The last submitted patch, payment_method_extend_and_test_permissions_00.patch, failed testing.

xano’s picture

Status: Needs work » Needs review
StatusFileSize
new29.52 KB

Status: Needs review » Needs work

The last submitted patch, payment_method_extend_and_test_permissions_01.patch, failed testing.

xano’s picture

Status: Needs work » Needs review
StatusFileSize
new22.27 KB

I reworked the tests so they are reusable, which saves a lot of code and will make it easy to test the same things for Payment entities and their administration pages as well.

Status: Needs review » Needs work

The last submitted patch, payment_method_extend_and_test_permissions_04.patch, failed testing.

xano’s picture

Status: Needs work » Needs review

Forgot to push. Re-testing.

xano’s picture

xano’s picture

Status: Needs review » Fixed

Committed to 7.x-1.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

xano’s picture

Assigned: xano » Unassigned