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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Post Type capabilities instead of All capabilities. #4122

Merged
merged 1 commit into from Dec 21, 2017

Conversation

Projects
None yet
3 participants
@imath
Contributor

imath commented Dec 21, 2017

#3895 showed there was an issue with SuperAdmins not having a role on a site of a multisite network. After some discussions, we think it is best to check the post type capabilities for the connected user and the current post type being edited.
A new parameter is added to the users/me REST API route containing the post type name. This parameter is used to get the corresponding post type capabilities.
Capability checks have been updated accordingly into Gutenberg editor components

Description

See #3895

How Has This Been Tested?

See #3895

Screenshots (jpeg or gifs if applicable):

See #3895

Types of changes

See #3895

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows has proper inline documentation.

@youknowriad Here's the new PR, i've found the time to do it during my lunch break 馃槈

Use Post Type capabilities instead of All capabilities.
#3895 showed there was an issue with SuperAdmins not having a role on a site of a multisite network. After some discussions, we think it is best to check the post type capabilities for the connected user and the current post type being edited.
A new parameter is added to the users/me REST API route containing the post type name. This parameter is used to get the corresponding post type capabilities.
Capability checks have been updated accordingly into Gutenberg editor components
@youknowriad

Awesome work, Thanks for addressing all of our comments

@youknowriad youknowriad merged commit 9c6143b into WordPress:master Dec 21, 2017

2 checks passed

codecov/project 39.09% (+0.03%) compared to af913fa
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@imath

This comment has been minimized.

Show comment
Hide comment
@imath

imath Dec 22, 2017

Contributor

yw many thanks for your help @youknowriad 馃憤

Contributor

imath commented Dec 22, 2017

yw many thanks for your help @youknowriad 馃憤

@mtias

This comment has been minimized.

Show comment
Hide comment
@mtias

mtias Jan 11, 2018

Contributor

Nice work here, thanks!

Contributor

mtias commented Jan 11, 2018

Nice work here, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment