Is there any way in Drupal to control access to users like it's done in `hook_node_access()` for nodes?
I'm looking for something like `hook_user_access()` or `hook_entity_access()`.

I have an entity reference field (user reference). I want that users can only select users from their organic group, in the entity reference field.

I wanted to do it by implementing some hook like `hook_entity_access()`, but this hook doesn't exist.