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.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | payment_method_extend_and_test_permissions_04.patch | 22.27 KB | xano |
| #3 | payment_method_extend_and_test_permissions_01.patch | 29.52 KB | xano |
| #1 | payment_method_extend_and_test_permissions_00.patch | 29.51 KB | xano |
Comments
Comment #1
xanoThis 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.
Comment #3
xanoComment #5
xanoI 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.
Comment #7
xanoForgot to push. Re-testing.
Comment #8
xano#5: payment_method_extend_and_test_permissions_04.patch queued for re-testing.
Comment #9
xanoCommitted to 7.x-1.x.
Comment #11
xano