Problem/Motivation
Make it easy to check access, therefore \Drupal should make it easy to find the access manager.
Proposed resolution
Put it onto the \Drupal class
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#12 | put_the_access_manager-2321809-12.patch | 1.12 KB | JeroenT |
#6 | put_access_manager_onto_drupal-2321809-6.patch | 520 bytes | undertext |
#2 | put_access_manager_onto_drupal-2321809-1.patch | 511 bytes | undertext |
Comments
Comment #1
undertext CreditAttribution: undertext commentedComment #2
undertext CreditAttribution: undertext commentedComment #3
dawehnerGreat!
Comment #4
m1r1k CreditAttribution: m1r1k commentedComment #5
herom CreditAttribution: herom commentedWe should probably typehint on "\Drupal\Core\Access\AccessManagerInterface"
Comment #6
undertext CreditAttribution: undertext commentedYeap. You are right.
Comment #7
herom CreditAttribution: herom commentedThat was it.
Comment #8
alexpottThis feels related to #2322809: Do not depend on event subscribers for security: Tighten routing security by access checking in matchRequest - if the access is checked by the router perhaps we don't need to do this?
Comment #9
dawehner@alexpott
Well, access is already checked during every request, with a quite small tiny possible time, when access is not checked. The access manager though
is used in more places than just routing of the current request. For example when you generate things like a link, having the access manager available
would be also a big gain. Making access checking easy should certainly be done.
Comment #10
dawehnerGiven my previous response ...
Comment #11
alexpottWe're missing a test in
\Drupal\Tests\Core\DrupalTest
Comment #12
JeroenTAdded a test for the accessmanager method.
Patch attached.
Comment #13
JeroenTComment #14
JeroenTComment #15
dawehnerGood point, alex
Comment #16
alexpottCommitted e3f8efb and pushed to 8.0.x. Thanks!