Main Features

Code is simple, and if you do not want to install the plugin, you can add the below code to your functions.php

//Restrict users who dont have capability edit_others_posts, to only see media they have uploaded themselves
function my_own_restrict_media($query)
{
//Check if it is an admin query
if ($query->is_admin && !current_user_can( 'edit_others_posts' ))
{
//Check if it is an attachment query
if ($query->query['post_type'] === 'attachment')
{
// Get current user, and author=current user to query
$current_user = wp_get_current_user();
$query->set('author', $current_user->ID);
}
}
return $query;
}
add_filter('pre_get_posts', 'my_own_restrict_media');