﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
22415	media-upload.php should check whether current user can edit a particular post type	danielbachhuber		"In /wp-admin/media-upload.php, there are a few checks for:

{{{
if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post' , $_REQUEST['post_id'] ) )
     wp_die( __( 'Cheatin&#8217; uh?' ) );
}}}

These should instead be (something like):

{{{
$obj = get_post_type_object( get_post_type( $_REQUEST['ID'] ) );
if ( ! current_user_can( $obj->cap->edit_post, $_REQUEST['ID' ) )
     wp_die( __( 'Cheatin&#8217; uh?' ) );
}}}

Although `$obj->cap->edit_post` can map to 'edit_post', sometimes map_meta_cap is bypassed in which case uploading media doesn't work.
    "	defect (bug)	closed	normal		Role/Capability		normal	wontfix		
