Problem/Motivation
This came up in #2885486: Media entity is revisionable but doesn't have a revision link template, where we discovered that providing a revision view route and checking access for that is not exactly trivial, even though it seems as though that could be solved generically, and also that node is not leading by example in this case.
Proposed resolution
Let's improve it!
Ideas:
- Add a generic entity revision access checker. In contrast to the generic
_entity_accessaccess checkr which can actually be used with revisions*, we probably also want to check if there are multiple revisions in the first place and deny access otherwise. Possibly other stuff, as well - If we can do the above, it should be possible to auto-generate the route in a route provider which would be nice
- ???
* To use the generic _entity_access access checker with revisions, you can do the following:
entity.myentity.revision:
path: /myentity/{myentity}/revisions/{myentity_revision}/view
...
requirements:
_entity_access: myentity_revision.view
options:
parameters:
myentity_revision:
type:
entity_revision: myentity
Comments
Comment #14
smustgrave commentedThank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!