[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 17:50:35 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 commit                              |
-------------------------------------------------+-------------------------
Changes (by iandunn):

 * keywords:  gdpr has-patch 2nd-opinion needs-unit-tests needs-testing =>
     gdpr has-patch 2nd-opinion needs-unit-tests commit


Comment:

 Ah, you're right. [attachment:44079.2.diff] was only working in my tests
 b/c I was in Multisite, and `has_cap()` always returns `true` as long as
 `$caps` doesn't contain `do_not_allow`.

 [attachment:44079.4.diff] restores the capability check for the notice
 ([https://wordpress.slack.com/archives/C9695RJBW/p1526406141000359?thread_ts=1526405976.000747&cid=C9695RJBW
 per Slack discussion]), and iterates on the comment to make it a bit more
 clear.

 This tested well for me in Multisite and single-site, but I'd like another
 committer's review before committing to `trunk`, to make sure we're not
 missing anything.

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


More information about the wp-trac mailing list