How to write custom access check for any entity
In this post, I will show you how to write custom access check for any entity, which can check more than user permission and role.
In Drupal 8/9, we can write custom access check for any entity, which can check more than user permission and role. For example, we can check if the user is the author of the node or not. If the user is the author of the node, then we can allow the user to edit the node.