Added ability to specify a visibility checking function. Defaults to isPublicContent.