- Issue created by @richard.thomas
- First commit to issue fork.
- Merge request !9Only check access for the route of the main request → (Merged) created by dieterholvoet
- 🇧🇪Belgium dieterholvoet Brussels
I haven't been able to properly test this, could you?
- 🇦🇺Australia richard.thomas
I did some local testing, the previous version didn't work as we still need to return allowed rather than neutral (as I understand it route access checks need to all return allowed to pass).
However while digging I found a more straightforward way of detecting if we're checking the main request, the access check can receive an optional request parameter, and according to the docs https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Access%21... the request parameter is only supplied when checking the main request. I've pushed up the change now, and it works on my local testing.
I noticed there's no CI tests for the module at the moment, but I'd be happy to write some as part of this change? Just covering the basic functionality plus checking the menu linkset endpoint to ensure this change works.
- 🇦🇺Australia richard.thomas
OK I've written some tests to ensure the menu linkset feature works as well as some general tests of the functionality of the module.
I've added in the template .gitlab-ci.yml file for contrib projects and disabled the linting stuff for now, so it's just running the PHPUnit tests.
-
dieterholvoet →
committed 1b8255d4 on 1.0.x
Issue #3533335 by richard.thomas, dieterholvoet: Access check prevents...
-
dieterholvoet →
committed 1b8255d4 on 1.0.x
- 🇧🇪Belgium dieterholvoet Brussels
I re-enabled linting and fixed some cs issues, all green now. Thanks a lot for your efforts! These new tests are very valuable.