Query-level filtering for custom entities in Drupal 8 and 9
Entity API is a great module that extends the entity API of Drupal core. One feature that I particularly like is the entity query access API. You can use it to alter entity queries and views, to only list the entities that the user has access to.