The permission 'administer coupons' is being used as an access argument for a few of the configuration urls, however this is the permission title not the machine name. The permission should be 'administer commerce_coupon entities'.

Comments

Eric115 created an issue. See original summary.

eric115’s picture

Patch attached.

eric115’s picture

Status: Active » Needs review
mglaman’s picture

Eric115, great catch. Would you mind writing a test? Post the test that fails, then combine the two to show it passes? If not I can whip up a test. Let me know.

eric115’s picture

Status: Needs review » Needs work

@mglaman, I am happy to write some tests for it. I will upload a new patch with some tests when they are done :)

eric115’s picture

Here is an updated patch and an example patch that fails.

eric115’s picture

Status: Needs work » Needs review

The last submitted patch, 6: administer-coupons-permission-2625600-6.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 6: test-fail-example-2625600-6.patch, failed testing.

eric115’s picture

Status: Needs work » Needs review
StatusFileSize
new10.3 KB
new10.3 KB

Whoops, bad patch files.

The last submitted patch, 10: test-fail-example-2625600-10.patch, failed testing.

mglaman’s picture

Status: Needs review » Needs work

I like the idea of moving to PSR-4 for tests, but it's making it hard to review. I don't see anywhere in the test a check for "admin/commerce/coupons/types" menu paths to verify permission is goofed.

mglaman’s picture

Status: Needs work » Needs review
StatusFileSize
new679 bytes

I like the idea of moving to PSR-4 for tests, but it's making it hard to review. I don't see anywhere in the test a check for "admin/commerce/coupons/types" menu paths to verify permission is goofed.

Here is a test to test the bad permissions.

mglaman’s picture

StatusFileSize
new2.19 KB

Here is patch from #13 with fix in #2. #13 should fail, this should pass.

The last submitted patch, 13: administer_coupons_-2625600-13.patch, failed testing.

mglaman’s picture

Status: Needs review » Fixed

Thanks!, committed.

  • mglaman committed 339c35c on 7.x-2.x
    Issue #2625600 by mglaman: Add test for permission
    
  • mglaman committed 508c2ed on 7.x-2.x authored by Eric115
    Issue #2625600 by Eric115, mglaman: 'Administer Coupons' permission...

Status: Fixed » Closed (fixed)

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