See #2945286: The "access overview" permission is not used/respected.
The EntityPermissionProvider provides access {$entity_type_id} overview. Generally this permission is used for the overridden collection routes of entities provided by a View. If the entity collection route is not overridden, the Core route provider sets the permission to the admin permission.
Entity API should have a route provider which respects the overview permission. It will need to check that the entity uses the EntityPermissionProvider handler and adds the overview permission alongside the admin permission.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 2951270-2.patch | 4.81 KB | mglaman |
Comments
Comment #2
mglamanHere is a patch. It would be simpler once in Core. Currently we have to provide an option for Admin and Default
htmlroute providers.Comment #3
mglamanThis manual definition prevented the entity route subscriber from executing.
Should I also test via Functional? Admin provider?
Comment #4
dawehnerFunctional test coverage sounds sensible here
The patch looks basically as expected.
Comment #5
lisastreeter commentedPatch applies cleanly and works as expected.
Comment #6
bojanz commentedThe providers look good.
The test looks bad. It's testing the same line that the code provides, which is fragile. I'd expect the test to have 3 users, one with no permission, one with the admin permission, one with the overview permission. Then we ensure that the last two grant access.
Comment #7
bojanz commentedClarity.
Comment #9
bojanz commentedReplaced the test and committed. Thanks!
Comment #10
tstoecklerJust opened #2953566: Allow entities to specify a "collection permission" to "fix" this properly in core, FYI.
Comment #12
wim leers