[wp-trac] [WordPress Trac] #54516: Full site editing/REST-API: modify permission checks to use post type.

WordPress Trac noreply at wordpress.org
Tue Dec 7 20:56:33 UTC 2021


#54516: Full site editing/REST-API: modify permission checks to use post type.
----------------------------+---------------------------
 Reporter:  peterwilsoncc   |       Owner:  spacedmonkey
     Type:  task (blessed)  |      Status:  closed
 Priority:  normal          |   Milestone:  5.9
Component:  REST API        |     Version:  trunk
 Severity:  normal          |  Resolution:  fixed
 Keywords:  has-patch       |     Focuses:  rest-api
----------------------------+---------------------------
Changes (by spacedmonkey):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"52342" 52342]:
 {{{
 #!CommitTicketReference repository="" revision="52342"
 REST API: Improve permission handling in global style endpoint.

 The new wp_global_styles post type is registered to use edit_theme_options
 in the capability settings. The WP_REST_Global_Styles_Controller class's
 permission checks methods use the capability in a hard coded form rather
 than looking up the capability via the post type object. Changing the
 permission callbacks to lookup capabilities via the post type object,
 allows theme and plugin developers to modify the capability used for
 editing global styles via a filter and these values to be respected via
 the Global Styles REST API.

 Props Spacedmonkey, peterwilsoncc, hellofromTonya , antonvlasenko,
 TimothyBlynJacobs, costdev, zieladam.
 Fixes #54516.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54516#comment:28>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list