Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#16295 closed enhancement (wontfix)

Authors can see files uploaded by other authors in Media Library

Reported by: andreyk Owned by:
Priority: normal Milestone:
Component: Media Version: 3.0.4
Severity: normal Keywords:
Cc:

Description

Hi,

I build a site for many users (but not multisite) and find that in the media library (wp-admin/upload.php) the 'author'-user (not admin) can see the list of all files uploaded by other authors.

It is not a problem in case users are close friends and the list is not large but it's unsuitable when users are competitors, also hundreds of other's pictures is a bother.

Yes, current_user_can() prevents from editing or deleting pictures uploaded by other users but there is no need even see them here (or maybe make this feature switchable)?

Attachments (1)

16295.diff (748 bytes) - added by solarissmoke 2 years ago.
Option to filter media list by author

Download all attachments as: .zip

Change History (10)

  • Keywords dev-feedback added; media upload capabilities removed

Yes, current_user_can() prevents from editing or deleting pictures uploaded by other users but there is no need even see them here (or maybe make this feature switchable)?

I think many sites do like users to be able to share media. However it might be a good idea to add an option to filter the list by author.

This would be pretty easy to do with a filter.

I wouldn't mind the suggestion of a 'Mine' link as it occurs for posts, but it seems like an edge case. (As it is, you need to be less than an Editor to be able to see that link for posts -- which perhaps is another story.)

if ( is_admin() )
	add_action( 'request', 'nacin_hide_uploads_from_other_users' );
function nacin_hide_uploads_from_other_users( $request ) {
	global $pagenow;
	if ( 'upload.php' == $pagenow && ! current_user_can( 'edit_others_posts' ) )
		$request['author'] = get_current_user_id();
	return $request;
}
  • Keywords has-patch added

Here's a patch that adds a filter for author.

Version 1, edited 2 years ago by solarissmoke (previous) (next) (diff)

Option to filter media list by author

When I said filter, I meant via a plugin. I don't see a need for a new UI dropdown. We don't even have an author dropdown on edit.php, where it would be more important. Limiting attachments by author is rather edge, certainly more so than posts.

  • Keywords dev-feedback has-patch removed

Okay fair enough - guess this can be closed then?

Ok, nacin's filter solves my problem.

  • Resolution set to wontfix
  • Status changed from new to closed
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.