[wp-trac] [WordPress Trac] #44079: Require `manage_privacy_options` capability to edit the privacy policy page

WordPress Trac noreply at wordpress.org
Tue May 15 13:43:33 UTC 2018


#44079: Require `manage_privacy_options` capability to edit the privacy policy page
-------------------------------------------------+-------------------------
 Reporter:  iandunn                              |       Owner:  iandunn
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  4.9.6
Component:  Administration                       |     Version:  trunk
 Severity:  normal                               |  Resolution:
 Keywords:  gdpr has-patch 2nd-opinion needs-    |     Focuses:
  unit-tests needs-testing                       |
-------------------------------------------------+-------------------------

Comment (by dlh):

 After testing further, I'm not sure that using either `map_meta_cap()`
 itself or the `map_meta_cap` filter will work for this purpose.

 If I'm reading correctly, because `manage_privacy_options` is a new meta
 capability, it needs to be mapped for it to be granted to anyone (by
 default).

 Appending `manage_privacy_options` to the array of required `$caps`
 doesn't allow that mapping to occur — the `case 'manage_privacy_options':`
 statement in `map_meta_cap()` is never reached.

 [attachment:44079.3.diff] attempts to allow `manage_privacy_options` to be
 mapped with another call to `map_meta_cap()`, although it's not nearly as
 straightforward an approach.

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


More information about the wp-trac mailing list