WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#16295 closed enhancement (wontfix)

Authors can see files uploaded by other authors in Media Library

Reported by: 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 3 years ago.
Option to filter media list by author

Download all attachments as: .zip

Change History (10)

comment:1 in reply to: ↑ description solarissmoke3 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.

comment:2 nacin3 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.)

comment:3 nacin3 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;
}

comment:4 solarissmoke3 years ago

  • Keywords has-patch added

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

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

solarissmoke3 years ago

Option to filter media list by author

comment:5 nacin3 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.

comment:6 solarissmoke3 years ago

  • Keywords dev-feedback has-patch removed

Okay fair enough - guess this can be closed then?

comment:7 andreyk3 years ago

Ok, nacin's filter solves my problem.

comment:8 solarissmoke3 years ago

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

comment:9 ocean903 years ago

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