Problem/Motivation
In order to be able to cache the rendered output of views result rows, we need support for it when we render entity operation links, see the https://qa.drupal.org/pifr/test/1022293 test failure.
Steps to reproduce
- I added a new content type.
- Role X has "edit own" permissions for this content type, but no other node permissions except view published content.
- User A and User B both have Role X.
- Admin user creates two nodes of the new content type, and makes User A the author of one node, and User B the author of the other node.
- View is created to display all nodes of the new content type; the view includes the Operations Links field.
- When Admin is logged in, the operations links (Edit, Delete) are available in the view for both nodes (which is the expected behavior).
- User A logs in, and the Edit link is available in the view only for the node that has User A as author (which is the expected behavior).
- User B logs in, and the Edit link is available in the view only for the node that has User A as author, when it should be for User B as author.
Taken from #2653690: Operations links field in Views fails between users with "edit own" user permissions
Proposed resolution
Add an access
key to each entity operation which contains an AccessResult object to determine whether the user has access to the operation. Use this to apply access to the rendered link, and bubble cacheability from the AccessResult object to the link.
Remaining tasks
Patch review