When an entity is saved the access records are not rebuilt. They only get rebuilt when the access storage is rebuilt for that entity type. This was intended but was never implemented.
This issue didn't present it self as the result of Nodes access being rebuilt by drupal core, but other entites such as paragraphs didn't have this happen. As a result, users may not have access to content as expected.
This caused an issue related to entity langcodes. Access records are matched based upon entity type, id, and langcode. If these don't match no records are returned. Drupal will sometimes update the langcode of entites (in particular paragraphs) to match the parent entity if. In my use case, some content has the langcode 'und' others has 'en' the same applies for paragraph content. When access control is rebuilt the access works as intended. When a node with a paragraph, where both had different langcodes, was saved the paragraphs where updated to match the langcode of the parent, but the access records were not rebuilt to match, resulting in access being denied for the paragraph entities. If the records updated on save, this issue would be mitigated.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 2964647-2-access-data-not-rebuilt.patch | 3.89 KB | richgerdes |
Comments
Comment #2
richgerdesPatch for issue.
Comment #4
richgerdesCommitted