By claudiu.cristea on
Change record status:
Draft (View all draft change records)
Project:
Introduced in branch:
9.2.x
Introduced in version:
9.2.0
Issue links:
Description:
Before
The Comments module used to do various access decisions by checking the appropriate permission. While that worked for many sites, it blocked defining more complex access check policies. For instance, some sites might want to check some field from the commented entity or, even, parent comment before granting access to write (create) a new comment. Even a third party module swaps the comment entity access control handler, it cannot do too much as the context passed to ::checkCreateAccess() is poor.
After
- Checks hardcoded to permissions were changed to checks done by the comment entity access control handler. Third party code may implement its own access logic by swapping the access handler.
- The "create access" handler receives valuable context data, such as commented entity and, on comment replying, the parent comment.
Impacts:
Module developers
Site templates, recipes and distribution developers