Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"upload_files" capability and Image relative blocks #3672

Closed
2 tasks
imath opened this issue Nov 27, 2017 · 2 comments · Fixed by #4155
Closed
2 tasks

"upload_files" capability and Image relative blocks #3672

imath opened this issue Nov 27, 2017 · 2 comments · Fixed by #4155
Labels
[Feature] Media Anything that impacts the experience of managing media REST API Interaction Related to REST API [Status] In Progress Tracking issues with work in progress

Comments

@imath
Copy link
Contributor

imath commented Nov 27, 2017

Issue Overview

Gutenberg version 1.7.0
When a contributor uses Gutenberg he can use Image relative blocks. When he tries to use it as this role hasn't got the upload_files capability, the REST reply to site.url/wp-json/wp/v2/media is rest_cannot_create (403).

Steps to Reproduce (for bugs)

  1. Log in as a contributor.
  2. Add a new post.
  3. Select the image block.
  4. Upload an image.
  5. The image shows for a few milliseconds.
  6. The Upload/Browse buttons are replacing the vanished image.
  7. No feedback is provided to the contributor untill the automatic save feature run. Then the error is: "This block has encountered an error and cannot be previewed."

Chrome Version 62.0.3202.94

Expected Behavior

Image/files relative blocks should only show if ( current_user_can( 'upload_files' ) )

Current Behavior

Image/files relative blocks are showing no matter the "upload_files" capability of the logged in user.

Possible Solution

Screenshots / Video

Here is some oxygen 😉 https://cldup.com/K8qYyaHWbI.mp4

Related Issues and/or PRs

Todos

  • Tests
  • Documentation
@mtias mtias added the [Feature] Media Anything that impacts the experience of managing media label Nov 27, 2017
@danielbachhuber danielbachhuber added this to the Merge Proposal: REST API milestone May 10, 2018
@danielbachhuber danielbachhuber added the REST API Interaction Related to REST API label May 10, 2018
@danielbachhuber
Copy link
Member

Related #6361

@noisysocks noisysocks self-assigned this Jul 23, 2018
@talldan talldan self-assigned this Aug 16, 2018
@noisysocks noisysocks removed their assignment Aug 17, 2018
@mtias mtias modified the milestones: Merge: REST API, WordPress 5.0 Oct 3, 2018
@mtias mtias added the [Status] In Progress Tracking issues with work in progress label Nov 14, 2018
@mtias
Copy link
Member

mtias commented Nov 14, 2018

Latest PR here: #4155

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Media Anything that impacts the experience of managing media REST API Interaction Related to REST API [Status] In Progress Tracking issues with work in progress
Projects
None yet
5 participants