Filter resource or resource-related entities by visibility.
Checks to see if the current user has permission to view resources. In this
case a resource is any entity that extends off the Resource entity, that is,
Item, ItemSet, and Media.
Modules may set these visibility rules on their resource-related entities by
attaching to the "sql_filter.resource_visibility" event (no identifier) and
setting the name of the foreign key column, keyed by the related entity's
class name, to the event's "relatedEntities" param.