Make WordPress Core

Opened 4 weeks ago

Closed 3 weeks ago

Last modified 3 days ago

#62042 closed defect (bug) (fixed)

Global Styles: allow read access to users with edit_posts capabilities

Reported by: ramonopoly's profile ramonopoly Owned by: ramonopoly's profile ramonopoly
Milestone: 6.7 Priority: normal
Severity: normal Version: trunk
Component: REST API Keywords: has-patch has-unit-tests
Focuses: rest-api Cc:

Description

This ticket tracks the syncing of the Gutenberg PR:

Global Styles: allow read access to users with edit_posts capabilities

The gist is to allow any role that can edit a post, including custom post types, to read global styles from the API and in the editor.

Why?

Block style variations and other global styles are not available to non-admin editors. See: https://github.com/WordPress/gutenberg/issues/64755

Furthermore, having global styles available in the post editor will, one day, allow block controls to reflect any values inherited from the theme/global styles. See: https://github.com/WordPress/gutenberg/issues/64670

Change History (10)

This ticket was mentioned in PR #7336 on WordPress/wordpress-develop by @ramonopoly.


4 weeks ago
#1

  • Keywords has-patch has-unit-tests added

#2 @spacedmonkey
4 weeks ago

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

Marking as duplicate of #54516

I really don’t like making this data more accessible than it was before. This imo is like exposing data. Also this change means we would make it hardest in the future to add custom permissions to this endpoint.

Let’s move the discussion to #54516 cc @peterwilsoncc @TimothyBlynJacobs

This ticket was mentioned in Slack in #core by spacedmonkey. View the logs.


4 weeks ago

#4 @peterwilsoncc
4 weeks ago

@spacedmonkey I'm not sure this is entirely a duplicate of the earlier issue. The earlier issue was to cover read and write capabilities, whereas this is exclusively about read permissions.

If custom styles are not reflected in the editor because post editors can't read them then I think, yes, they ought to be available for read access by post editors. If that's the case, they will need to consider further instances such as when an auhtor can edit custom post types using custom capabilities.

This ticket was mentioned in Slack in #core by peterwilsoncc. View the logs.


4 weeks ago

#6 @ramonopoly
4 weeks ago

  • Resolution duplicate deleted
  • Status changed from closed to reopened

whereas this is exclusively about read permissions.

Thanks @peterwilsoncc

Yes, it's strictly about read access in the editor, so folks who already have edit posts capabilities.

I understand there's a larger scope regarding permissions for the post type in general, and also that there are nuances about permissions that the proposed PRs might have missed, so any constructive feedback is very welcome.

I'll reopen for now pending further discussion.

#7 @peterwilsoncc
4 weeks ago

  • Milestone set to 6.7
  • Type changed from enhancement to defect (bug)

I've moved this to the milestone and reclassified it as a bug fix for the upstream ticket GB#64755.

#8 @ramonopoly
3 weeks ago

  • Owner set to ramonopoly
  • Resolution set to fixed
  • Status changed from reopened to closed

In 59048:

Global Styles: allow read access to users with edit_posts capabilities

This patch any role that can edit a post, including custom post types, or edit theme options to read global styles from the API. This enables read-only access to global styles in the post editor. Test coverage in included.

Props ramonopoly, peterwilsoncc, mukesh27, aaronrobertshaw, mamaduka, spacedmonkey, talldanwp, timothyblynjacobs.
Fixes #62042.

@ramonopoly commented on PR #7336:


3 weeks ago
#9

Committed in r59048 / 52d46a9cb3d808340f2d7b35a0120354bf8ecaf2

This ticket was mentioned in Slack in #core by ramonopoly. View the logs.


3 days ago

Note: See TracTickets for help on using tickets.