Problem/Motivation
Routing access checks can declare that they need the request by specifying needs_incoming_request: TRUE
\Drupal\Core\Access\AccessManager::check() is only passed the request when checking the incoming request. It is not passed a request when checking routes on output (like when rendering menu links, local tasks, etc).
If all of the access checks are dependent on the request, the result will be AccessResult::neutral() (aka access denied).
This is correct behavior, but can be confusing.
Proposed resolution
If all access checks are dependent on the request, warn the developer.
Currently, attempt to do that via a deprecation.
Remaining tasks
- Decide if this should be a deprecation or just written to the log
- Determine if this is the best place to do this, or if it can be accomplished during router rebuild
User interface changes
N/A
API changes
TBD
Data model changes
N/A
Release notes snippet
TBD
Comments
Comment #2
tim.plunkettComment #3
wim leers👍
Comment #8
smustgrave commentedThis issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.
Think this will need a test case to show the issue. Patch needs to be updated for the trigger_error pattern.