Problem/Motivation
As per issue title, some routes implement _entity_access. In those cases, creating custom permissions based on the route alone won't work.
Steps to reproduce
Take the "administer date-time" permission for example, which is to allow people to view the list of date formats, and also allow them to create new formats, as well as to allow editing/deleting existing formats. That permission has the following routes configured:
- entity.date_format.collection
- system.date_format_add
- entity.date_format.edit_form
- entity.date_format.delete_form
So in theory, you've got everything required for the permission to work as expected. What happens in reality though is that people with roles that have that permission granted are only able to access the date/time formats listing page, and create new formats. They cannot edit/delete formats, as the operations dropbuttons are not being rendered at all.
The above also has the side effect of people being able to create a new format, but soon as they create it, they cannot edit/delete it.
Proposed resolution
Allow specifying entity access for permissions, and have that work.
Remaining tasks
- Figure out how to make this work.
- Write the code for it.
- Review and test the code.
- Merge the changes.
- Create a new release of the module.
- Close this issue.
User interface changes
There will be another column in the custom permissions configuration page, which will allow people to configure any required entity permissions.
API changes
TBD
Data model changes
TBD