Make WordPress Core

Opened 13 years ago

Closed 10 years ago

#21091 closed defect (bug) (duplicate)

Unable to upload media with custom permissions

Reported by: havahula's profile havahula Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4
Component: Media Keywords: reporter-feedback close
Focuses: Cc:

Description

on the current version of wp-admin/media-upload.php there are now several checks to ensure that the user can edit the post using current_user_can( 'edit_post', $_REQUESTpost_id? ). it appears that there is a typo as the capability as it is written currently is 'edit_post' and it should be 'edit_posts', correct?

I noticed this on a site I manage where contributors have been given the capability to upload media but are no longer able to unless media-upload.php is edited to match their built-in capability.

Change History (5)

#1 @duck_
13 years ago

  • Keywords reporter-feedback close added
  • Summary changed from wp_capabilities typo? to Unable to upload media with custom permissions

edit_post is a meta capability which is translated into a concrete capability such as edit_posts or edit_pubished_posts by the map_meta_cap() function.

There's not enough information in this ticket to say for sure if this isn't a bug, but it sounds like your contributor with the custom capability is attempting to attach media to an already published post or some other post that they do not have sufficient capabilities to edit normally.

#2 follow-up: @markoheijnen
13 years ago

There is something weird going on. Just tried it myself. When a user doesn't have edit_post(s) capability and does upload a new media item it still breaks for HTML5 uploader. However it doesn't do that for the browser uploader

#3 in reply to: ↑ 2 @SergeyBiryukov
13 years ago

Replying to markoheijnen:

When a user doesn't have edit_post(s) capability and does upload a new media item it still breaks for HTML5 uploader.

Related: #19817, #19834, #20638

#4 @SergeyBiryukov
12 years ago

Sounds like a duplicate of #19817.

#5 @wonderboymusic
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #19817.

Note: See TracTickets for help on using tickets.