Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#16295 closed enhancement (wontfix)

Authors can see files uploaded by other authors in Media Library

Reported by: andreyk's profile andreyk Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0.4
Component: Media Keywords:
Focuses: 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 13 years ago.
Option to filter media list by author

Download all attachments as: .zip

Change History (10)

#1 in reply to: ↑ description @solarissmoke
13 years ago

  • 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.

#2 @nacin
13 years ago

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.)

#3 @nacin
13 years ago

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;
}

#4 @solarissmoke
13 years ago

  • Keywords has-patch added

Here's a patch that adds a dropdown to filter the media list by author.

Last edited 13 years ago by solarissmoke (previous) (diff)

@solarissmoke
13 years ago

Option to filter media list by author

#5 @nacin
13 years ago

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.

#6 @solarissmoke
13 years ago

  • Keywords dev-feedback has-patch removed

Okay fair enough - guess this can be closed then?

#7 @andreyk
13 years ago

Ok, nacin's filter solves my problem.

#8 @solarissmoke
13 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

#9 @ocean90
13 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.