This task might be moved into the suggested module one day.
Today I ran into the demand to need something that in former times (Drupal 7) the following two modules solved:
which worked, simple and great.
Similar to this module, the access to the host entity is determined by access to the referenced entity.
With Drupal 10 we don't separate node / user / taxonomy / ... reference fields anymore, so it would be the same logic for all kinds of references.
https://www.drupal.org/project/access_by_ref → seems to do similar things, but UX / DX is strange and it doesn't work as expected for me ( 💬 How to deny access to a published node, if access isn't given by reference? Active )
With entity_access_by_role_field as basis, I think it shouldn't be too hard to implement what's needed for a GREAT and general module.
Fixed
1.0
Code