add the `privacy` field to the media table
Update the media Model class with the privacy column
Only show recent media that is PUBLIC
Allow filtering by privacy
Show all media for managers (even private and unlisted)
Only show public media in the popular list
Only show public media in text search
Only show public media in keyword searches
Add privacy settings to the media form
Don't rely on $context->media being set
Protect private media
Allow setting media as private
add helper text to the privacy field
Add a newline at eof

to make Kevin happy
No need to continue the loop if we've found what we're looking for.
add a filter for user and media id
Don't query for permission value every iteration
Grant view permission the the user is a member of any of the feeds
move viewable permission logic

Move it to the media object.
Add a method to get possible privacy values

Should make it a little easier to access