<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[47269] trunk: Privacy: Un-map privacy capabilities to make them available to be assigned for custom roles:</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/47269">47269</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/47269","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>SergeyBiryukov</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2020-02-11 18:34:08 +0000 (Tue, 11 Feb 2020)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Privacy: Un-map privacy capabilities to make them available to be assigned for custom roles:
* `erase_others_personal_data`
* `export_others_personal_data`
* `manage_privacy_options`
Previously mapped to `manage_options` or `manage_network` (on Multisite), these are now added to the Administrator role separately.
Additionally, `manage_privacy_options` is added to the Editor role.
Props garrett-eclipse, xkon, pbiron, desrosj, johnbillion, flixos90, juliobox, lakenh, Ov3rfly, ianatkins.
Fixes <a href="https://core.trac.wordpress.org/ticket/44176">#44176</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesschemaphp">trunk/src/wp-admin/includes/schema.php</a></li>
<li><a href="#trunksrcwpadminincludesupgradephp">trunk/src/wp-admin/includes/upgrade.php</a></li>
<li><a href="#trunksrcwpadminmenuphp">trunk/src/wp-admin/menu.php</a></li>
<li><a href="#trunksrcwpincludescapabilitiesphp">trunk/src/wp-includes/capabilities.php</a></li>
<li><a href="#trunksrcwpincludesversionphp">trunk/src/wp-includes/version.php</a></li>
<li><a href="#trunktestsphpunittestsusercapabilitiesphp">trunk/tests/phpunit/tests/user/capabilities.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesschemaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/schema.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/schema.php 2020-02-11 16:46:10 UTC (rev 47268)
+++ trunk/src/wp-admin/includes/schema.php 2020-02-11 18:34:08 UTC (rev 47269)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -695,6 +695,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> populate_roles_270();
</span><span class="cx" style="display: block; padding: 0 10px"> populate_roles_280();
</span><span class="cx" style="display: block; padding: 0 10px"> populate_roles_300();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ populate_roles_540();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -923,6 +924,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Create and modify WordPress roles for WordPress 5.4.0.
+ *
+ * @since 5.4.0
+ */
+function populate_roles_540() {
+ // Add the privacy caps to the Administrators.
+ $role = get_role( 'administrator' );
+
+ if ( ! empty( $role ) ) {
+ $role->add_cap( 'export_others_personal_data' );
+ $role->add_cap( 'erase_others_personal_data' );
+ $role->add_cap( 'manage_privacy_options' );
+ }
+
+ $role = get_role( 'editor' );
+ if ( ! empty( $role ) ) {
+ $role->add_cap( 'manage_privacy_options' );
+ }
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! function_exists( 'install_network' ) ) :
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Install Network.
</span></span></pre></div>
<a id="trunksrcwpadminincludesupgradephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/upgrade.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/upgrade.php 2020-02-11 16:46:10 UTC (rev 47268)
+++ trunk/src/wp-admin/includes/upgrade.php 2020-02-11 18:34:08 UTC (rev 47269)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -834,6 +834,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> upgrade_530();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $wp_current_db_version < 47269 ) {
+ upgrade_540();
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> maybe_disable_link_manager();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> maybe_disable_automattic_widgets();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2155,6 +2159,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Executes changes made in WordPress 5.4.0.
+ *
+ * @ignore
+ * @since 5.4.0
+ *
+ * @global int $wp_current_db_version The old (current) database version.
+ */
+function upgrade_540() {
+ global $wp_current_db_version;
+
+ if ( $wp_current_db_version < 47269 ) {
+ populate_roles_540();
+ }
+}
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Executes network-level upgrade routines.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span></span></pre></div>
<a id="trunksrcwpadminmenuphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/menu.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/menu.php 2020-02-11 16:46:10 UTC (rev 47268)
+++ trunk/src/wp-admin/menu.php 2020-02-11 18:34:08 UTC (rev 47269)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -288,7 +288,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $submenu['tools.php'][50] = array( __( 'Network Setup' ), 'setup_network', 'network.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-$menu[80] = array( __( 'Settings' ), 'manage_options', 'options-general.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+$menu[80] = array( __( 'Settings' ), 'manage_options', 'options-general.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' );
+if ( current_user_can( 'manage_privacy_options' ) && ! current_user_can( 'manage_options' ) ) {
+ $menu[80] = array( __( 'Settings' ), 'manage_privacy_options', 'options-privacy.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' );
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $submenu['options-general.php'][10] = array( _x( 'General', 'settings screen' ), 'manage_options', 'options-general.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> $submenu['options-general.php'][15] = array( __( 'Writing' ), 'manage_options', 'options-writing.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> $submenu['options-general.php'][20] = array( __( 'Reading' ), 'manage_options', 'options-reading.php' );
</span></span></pre></div>
<a id="trunksrcwpincludescapabilitiesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/capabilities.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/capabilities.php 2020-02-11 16:46:10 UTC (rev 47268)
+++ trunk/src/wp-includes/capabilities.php 2020-02-11 18:34:08 UTC (rev 47269)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -132,7 +132,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * so deleting it should require that too.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> if ( (int) get_option( 'wp_page_for_privacy_policy' ) === $post->ID ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $caps = array_merge( $caps, map_meta_cap( 'manage_privacy_options', $user_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $caps[] = 'manage_privacy_options';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -203,7 +203,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * so editing it should require that too.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> if ( (int) get_option( 'wp_page_for_privacy_policy' ) === $post->ID ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $caps = array_merge( $caps, map_meta_cap( 'manage_privacy_options', $user_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $caps[] = 'manage_privacy_options';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -580,11 +580,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $caps[] = 'update_core';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case 'export_others_personal_data':
- case 'erase_others_personal_data':
- case 'manage_privacy_options':
- $caps[] = is_multisite() ? 'manage_network' : 'manage_options';
- break;
</del><span class="cx" style="display: block; padding: 0 10px"> default:
</span><span class="cx" style="display: block; padding: 0 10px"> // Handle meta capabilities for custom post types.
</span><span class="cx" style="display: block; padding: 0 10px"> global $post_type_meta_caps;
</span></span></pre></div>
<a id="trunksrcwpincludesversionphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/version.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/version.php 2020-02-11 16:46:10 UTC (rev 47268)
+++ trunk/src/wp-includes/version.php 2020-02-11 18:34:08 UTC (rev 47269)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,7 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global int $wp_db_version
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-$wp_db_version = 47018;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+$wp_db_version = 47269;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Holds the TinyMCE version.
</span></span></pre></div>
<a id="trunktestsphpunittestsusercapabilitiesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/user/capabilities.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user/capabilities.php 2020-02-11 16:46:10 UTC (rev 47268)
+++ trunk/tests/phpunit/tests/user/capabilities.php 2020-02-11 18:34:08 UTC (rev 47269)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -76,81 +76,85 @@
</span><span class="cx" style="display: block; padding: 0 10px"> final private function _getSingleSitePrimitiveCaps() {
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'unfiltered_html' => array( 'administrator', 'editor' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'unfiltered_html' => array( 'administrator', 'editor' ),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'activate_plugins' => array( 'administrator' ),
- 'create_users' => array( 'administrator' ),
- 'delete_plugins' => array( 'administrator' ),
- 'delete_themes' => array( 'administrator' ),
- 'delete_users' => array( 'administrator' ),
- 'edit_files' => array( 'administrator' ),
- 'edit_plugins' => array( 'administrator' ),
- 'edit_themes' => array( 'administrator' ),
- 'edit_users' => array( 'administrator' ),
- 'install_plugins' => array( 'administrator' ),
- 'install_themes' => array( 'administrator' ),
- 'update_core' => array( 'administrator' ),
- 'update_plugins' => array( 'administrator' ),
- 'update_themes' => array( 'administrator' ),
- 'edit_theme_options' => array( 'administrator' ),
- 'export' => array( 'administrator' ),
- 'import' => array( 'administrator' ),
- 'list_users' => array( 'administrator' ),
- 'manage_options' => array( 'administrator' ),
- 'promote_users' => array( 'administrator' ),
- 'remove_users' => array( 'administrator' ),
- 'switch_themes' => array( 'administrator' ),
- 'edit_dashboard' => array( 'administrator' ),
- 'resume_plugins' => array( 'administrator' ),
- 'resume_themes' => array( 'administrator' ),
- 'view_site_health_checks' => array( 'administrator' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'activate_plugins' => array( 'administrator' ),
+ 'create_users' => array( 'administrator' ),
+ 'delete_plugins' => array( 'administrator' ),
+ 'delete_themes' => array( 'administrator' ),
+ 'delete_users' => array( 'administrator' ),
+ 'edit_files' => array( 'administrator' ),
+ 'edit_plugins' => array( 'administrator' ),
+ 'edit_themes' => array( 'administrator' ),
+ 'edit_users' => array( 'administrator' ),
+ 'install_plugins' => array( 'administrator' ),
+ 'install_themes' => array( 'administrator' ),
+ 'update_core' => array( 'administrator' ),
+ 'update_plugins' => array( 'administrator' ),
+ 'update_themes' => array( 'administrator' ),
+ 'edit_theme_options' => array( 'administrator' ),
+ 'export' => array( 'administrator' ),
+ 'import' => array( 'administrator' ),
+ 'list_users' => array( 'administrator' ),
+ 'manage_options' => array( 'administrator' ),
+ 'promote_users' => array( 'administrator' ),
+ 'remove_users' => array( 'administrator' ),
+ 'switch_themes' => array( 'administrator' ),
+ 'edit_dashboard' => array( 'administrator' ),
+ 'resume_plugins' => array( 'administrator' ),
+ 'resume_themes' => array( 'administrator' ),
+ 'view_site_health_checks' => array( 'administrator' ),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'moderate_comments' => array( 'administrator', 'editor' ),
- 'manage_categories' => array( 'administrator', 'editor' ),
- 'edit_others_posts' => array( 'administrator', 'editor' ),
- 'edit_pages' => array( 'administrator', 'editor' ),
- 'edit_others_pages' => array( 'administrator', 'editor' ),
- 'edit_published_pages' => array( 'administrator', 'editor' ),
- 'publish_pages' => array( 'administrator', 'editor' ),
- 'delete_pages' => array( 'administrator', 'editor' ),
- 'delete_others_pages' => array( 'administrator', 'editor' ),
- 'delete_published_pages' => array( 'administrator', 'editor' ),
- 'delete_others_posts' => array( 'administrator', 'editor' ),
- 'delete_private_posts' => array( 'administrator', 'editor' ),
- 'edit_private_posts' => array( 'administrator', 'editor' ),
- 'read_private_posts' => array( 'administrator', 'editor' ),
- 'delete_private_pages' => array( 'administrator', 'editor' ),
- 'edit_private_pages' => array( 'administrator', 'editor' ),
- 'read_private_pages' => array( 'administrator', 'editor' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'manage_privacy_options' => array( 'administrator', 'editor' ),
+ 'export_others_personal_data' => array( 'administrator' ),
+ 'erase_others_personal_data' => array( 'administrator' ),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'edit_published_posts' => array( 'administrator', 'editor', 'author' ),
- 'upload_files' => array( 'administrator', 'editor', 'author' ),
- 'publish_posts' => array( 'administrator', 'editor', 'author' ),
- 'delete_published_posts' => array( 'administrator', 'editor', 'author' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'moderate_comments' => array( 'administrator', 'editor' ),
+ 'manage_categories' => array( 'administrator', 'editor' ),
+ 'edit_others_posts' => array( 'administrator', 'editor' ),
+ 'edit_pages' => array( 'administrator', 'editor' ),
+ 'edit_others_pages' => array( 'administrator', 'editor' ),
+ 'edit_published_pages' => array( 'administrator', 'editor' ),
+ 'publish_pages' => array( 'administrator', 'editor' ),
+ 'delete_pages' => array( 'administrator', 'editor' ),
+ 'delete_others_pages' => array( 'administrator', 'editor' ),
+ 'delete_published_pages' => array( 'administrator', 'editor' ),
+ 'delete_others_posts' => array( 'administrator', 'editor' ),
+ 'delete_private_posts' => array( 'administrator', 'editor' ),
+ 'edit_private_posts' => array( 'administrator', 'editor' ),
+ 'read_private_posts' => array( 'administrator', 'editor' ),
+ 'delete_private_pages' => array( 'administrator', 'editor' ),
+ 'edit_private_pages' => array( 'administrator', 'editor' ),
+ 'read_private_pages' => array( 'administrator', 'editor' ),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'edit_posts' => array( 'administrator', 'editor', 'author', 'contributor' ),
- 'delete_posts' => array( 'administrator', 'editor', 'author', 'contributor' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'edit_published_posts' => array( 'administrator', 'editor', 'author' ),
+ 'upload_files' => array( 'administrator', 'editor', 'author' ),
+ 'publish_posts' => array( 'administrator', 'editor', 'author' ),
+ 'delete_published_posts' => array( 'administrator', 'editor', 'author' ),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'read' => array( 'administrator', 'editor', 'author', 'contributor', 'subscriber' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'edit_posts' => array( 'administrator', 'editor', 'author', 'contributor' ),
+ 'delete_posts' => array( 'administrator', 'editor', 'author', 'contributor' ),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'level_10' => array( 'administrator' ),
- 'level_9' => array( 'administrator' ),
- 'level_8' => array( 'administrator' ),
- 'level_7' => array( 'administrator', 'editor' ),
- 'level_6' => array( 'administrator', 'editor' ),
- 'level_5' => array( 'administrator', 'editor' ),
- 'level_4' => array( 'administrator', 'editor' ),
- 'level_3' => array( 'administrator', 'editor' ),
- 'level_2' => array( 'administrator', 'editor', 'author' ),
- 'level_1' => array( 'administrator', 'editor', 'author', 'contributor' ),
- 'level_0' => array( 'administrator', 'editor', 'author', 'contributor', 'subscriber' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'read' => array( 'administrator', 'editor', 'author', 'contributor', 'subscriber' ),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'administrator' => array( 'administrator' ),
- 'editor' => array( 'editor' ),
- 'author' => array( 'author' ),
- 'contributor' => array( 'contributor' ),
- 'subscriber' => array( 'subscriber' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'level_10' => array( 'administrator' ),
+ 'level_9' => array( 'administrator' ),
+ 'level_8' => array( 'administrator' ),
+ 'level_7' => array( 'administrator', 'editor' ),
+ 'level_6' => array( 'administrator', 'editor' ),
+ 'level_5' => array( 'administrator', 'editor' ),
+ 'level_4' => array( 'administrator', 'editor' ),
+ 'level_3' => array( 'administrator', 'editor' ),
+ 'level_2' => array( 'administrator', 'editor', 'author' ),
+ 'level_1' => array( 'administrator', 'editor', 'author', 'contributor' ),
+ 'level_0' => array( 'administrator', 'editor', 'author', 'contributor', 'subscriber' ),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'administrator' => array( 'administrator' ),
+ 'editor' => array( 'editor' ),
+ 'author' => array( 'author' ),
+ 'contributor' => array( 'contributor' ),
+ 'subscriber' => array( 'subscriber' ),
+
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -158,82 +162,86 @@
</span><span class="cx" style="display: block; padding: 0 10px"> final private function _getMultiSitePrimitiveCaps() {
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'unfiltered_html' => array(),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'unfiltered_html' => array(),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'activate_plugins' => array(),
- 'create_users' => array(),
- 'delete_plugins' => array(),
- 'delete_themes' => array(),
- 'delete_users' => array(),
- 'edit_files' => array(),
- 'edit_plugins' => array(),
- 'edit_themes' => array(),
- 'edit_users' => array(),
- 'install_plugins' => array(),
- 'install_themes' => array(),
- 'update_core' => array(),
- 'update_plugins' => array(),
- 'update_themes' => array(),
- 'view_site_health_checks' => array(),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'activate_plugins' => array(),
+ 'create_users' => array(),
+ 'delete_plugins' => array(),
+ 'delete_themes' => array(),
+ 'delete_users' => array(),
+ 'edit_files' => array(),
+ 'edit_plugins' => array(),
+ 'edit_themes' => array(),
+ 'edit_users' => array(),
+ 'install_plugins' => array(),
+ 'install_themes' => array(),
+ 'update_core' => array(),
+ 'update_plugins' => array(),
+ 'update_themes' => array(),
+ 'view_site_health_checks' => array(),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'edit_theme_options' => array( 'administrator' ),
- 'export' => array( 'administrator' ),
- 'import' => array( 'administrator' ),
- 'list_users' => array( 'administrator' ),
- 'manage_options' => array( 'administrator' ),
- 'promote_users' => array( 'administrator' ),
- 'remove_users' => array( 'administrator' ),
- 'switch_themes' => array( 'administrator' ),
- 'edit_dashboard' => array( 'administrator' ),
- 'resume_plugins' => array( 'administrator' ),
- 'resume_themes' => array( 'administrator' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'manage_privacy_options' => array( 'administrator', 'editor' ),
+ 'export_others_personal_data' => array( 'administrator' ),
+ 'erase_others_personal_data' => array( 'administrator' ),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'moderate_comments' => array( 'administrator', 'editor' ),
- 'manage_categories' => array( 'administrator', 'editor' ),
- 'edit_others_posts' => array( 'administrator', 'editor' ),
- 'edit_pages' => array( 'administrator', 'editor' ),
- 'edit_others_pages' => array( 'administrator', 'editor' ),
- 'edit_published_pages' => array( 'administrator', 'editor' ),
- 'publish_pages' => array( 'administrator', 'editor' ),
- 'delete_pages' => array( 'administrator', 'editor' ),
- 'delete_others_pages' => array( 'administrator', 'editor' ),
- 'delete_published_pages' => array( 'administrator', 'editor' ),
- 'delete_others_posts' => array( 'administrator', 'editor' ),
- 'delete_private_posts' => array( 'administrator', 'editor' ),
- 'edit_private_posts' => array( 'administrator', 'editor' ),
- 'read_private_posts' => array( 'administrator', 'editor' ),
- 'delete_private_pages' => array( 'administrator', 'editor' ),
- 'edit_private_pages' => array( 'administrator', 'editor' ),
- 'read_private_pages' => array( 'administrator', 'editor' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'edit_theme_options' => array( 'administrator' ),
+ 'export' => array( 'administrator' ),
+ 'import' => array( 'administrator' ),
+ 'list_users' => array( 'administrator' ),
+ 'manage_options' => array( 'administrator' ),
+ 'promote_users' => array( 'administrator' ),
+ 'remove_users' => array( 'administrator' ),
+ 'switch_themes' => array( 'administrator' ),
+ 'edit_dashboard' => array( 'administrator' ),
+ 'resume_plugins' => array( 'administrator' ),
+ 'resume_themes' => array( 'administrator' ),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'edit_published_posts' => array( 'administrator', 'editor', 'author' ),
- 'upload_files' => array( 'administrator', 'editor', 'author' ),
- 'publish_posts' => array( 'administrator', 'editor', 'author' ),
- 'delete_published_posts' => array( 'administrator', 'editor', 'author' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'moderate_comments' => array( 'administrator', 'editor' ),
+ 'manage_categories' => array( 'administrator', 'editor' ),
+ 'edit_others_posts' => array( 'administrator', 'editor' ),
+ 'edit_pages' => array( 'administrator', 'editor' ),
+ 'edit_others_pages' => array( 'administrator', 'editor' ),
+ 'edit_published_pages' => array( 'administrator', 'editor' ),
+ 'publish_pages' => array( 'administrator', 'editor' ),
+ 'delete_pages' => array( 'administrator', 'editor' ),
+ 'delete_others_pages' => array( 'administrator', 'editor' ),
+ 'delete_published_pages' => array( 'administrator', 'editor' ),
+ 'delete_others_posts' => array( 'administrator', 'editor' ),
+ 'delete_private_posts' => array( 'administrator', 'editor' ),
+ 'edit_private_posts' => array( 'administrator', 'editor' ),
+ 'read_private_posts' => array( 'administrator', 'editor' ),
+ 'delete_private_pages' => array( 'administrator', 'editor' ),
+ 'edit_private_pages' => array( 'administrator', 'editor' ),
+ 'read_private_pages' => array( 'administrator', 'editor' ),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'edit_posts' => array( 'administrator', 'editor', 'author', 'contributor' ),
- 'delete_posts' => array( 'administrator', 'editor', 'author', 'contributor' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'edit_published_posts' => array( 'administrator', 'editor', 'author' ),
+ 'upload_files' => array( 'administrator', 'editor', 'author' ),
+ 'publish_posts' => array( 'administrator', 'editor', 'author' ),
+ 'delete_published_posts' => array( 'administrator', 'editor', 'author' ),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'read' => array( 'administrator', 'editor', 'author', 'contributor', 'subscriber' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'edit_posts' => array( 'administrator', 'editor', 'author', 'contributor' ),
+ 'delete_posts' => array( 'administrator', 'editor', 'author', 'contributor' ),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'level_10' => array( 'administrator' ),
- 'level_9' => array( 'administrator' ),
- 'level_8' => array( 'administrator' ),
- 'level_7' => array( 'administrator', 'editor' ),
- 'level_6' => array( 'administrator', 'editor' ),
- 'level_5' => array( 'administrator', 'editor' ),
- 'level_4' => array( 'administrator', 'editor' ),
- 'level_3' => array( 'administrator', 'editor' ),
- 'level_2' => array( 'administrator', 'editor', 'author' ),
- 'level_1' => array( 'administrator', 'editor', 'author', 'contributor' ),
- 'level_0' => array( 'administrator', 'editor', 'author', 'contributor', 'subscriber' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'read' => array( 'administrator', 'editor', 'author', 'contributor', 'subscriber' ),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'administrator' => array( 'administrator' ),
- 'editor' => array( 'editor' ),
- 'author' => array( 'author' ),
- 'contributor' => array( 'contributor' ),
- 'subscriber' => array( 'subscriber' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'level_10' => array( 'administrator' ),
+ 'level_9' => array( 'administrator' ),
+ 'level_8' => array( 'administrator' ),
+ 'level_7' => array( 'administrator', 'editor' ),
+ 'level_6' => array( 'administrator', 'editor' ),
+ 'level_5' => array( 'administrator', 'editor' ),
+ 'level_4' => array( 'administrator', 'editor' ),
+ 'level_3' => array( 'administrator', 'editor' ),
+ 'level_2' => array( 'administrator', 'editor', 'author' ),
+ 'level_1' => array( 'administrator', 'editor', 'author', 'contributor' ),
+ 'level_0' => array( 'administrator', 'editor', 'author', 'contributor', 'subscriber' ),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'administrator' => array( 'administrator' ),
+ 'editor' => array( 'editor' ),
+ 'author' => array( 'author' ),
+ 'contributor' => array( 'contributor' ),
+ 'subscriber' => array( 'subscriber' ),
+
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -240,77 +248,71 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> final private function _getSingleSiteMetaCaps() {
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'create_sites' => array(),
- 'delete_sites' => array(),
- 'manage_network' => array(),
- 'manage_sites' => array(),
- 'manage_network_users' => array(),
- 'manage_network_plugins' => array(),
- 'manage_network_themes' => array(),
- 'manage_network_options' => array(),
- 'delete_site' => array(),
- 'upgrade_network' => array(),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'create_sites' => array(),
+ 'delete_sites' => array(),
+ 'manage_network' => array(),
+ 'manage_sites' => array(),
+ 'manage_network_users' => array(),
+ 'manage_network_plugins' => array(),
+ 'manage_network_themes' => array(),
+ 'manage_network_options' => array(),
+ 'delete_site' => array(),
+ 'upgrade_network' => array(),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'setup_network' => array( 'administrator' ),
- 'upload_plugins' => array( 'administrator' ),
- 'upload_themes' => array( 'administrator' ),
- 'customize' => array( 'administrator' ),
- 'add_users' => array( 'administrator' ),
- 'install_languages' => array( 'administrator' ),
- 'update_languages' => array( 'administrator' ),
- 'deactivate_plugins' => array( 'administrator' ),
- 'update_php' => array( 'administrator' ),
- 'export_others_personal_data' => array( 'administrator' ),
- 'erase_others_personal_data' => array( 'administrator' ),
- 'manage_privacy_options' => array( 'administrator' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'setup_network' => array( 'administrator' ),
+ 'upload_plugins' => array( 'administrator' ),
+ 'upload_themes' => array( 'administrator' ),
+ 'customize' => array( 'administrator' ),
+ 'add_users' => array( 'administrator' ),
+ 'install_languages' => array( 'administrator' ),
+ 'update_languages' => array( 'administrator' ),
+ 'deactivate_plugins' => array( 'administrator' ),
+ 'update_php' => array( 'administrator' ),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'edit_categories' => array( 'administrator', 'editor' ),
- 'delete_categories' => array( 'administrator', 'editor' ),
- 'manage_post_tags' => array( 'administrator', 'editor' ),
- 'edit_post_tags' => array( 'administrator', 'editor' ),
- 'delete_post_tags' => array( 'administrator', 'editor' ),
- 'edit_css' => array( 'administrator', 'editor' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'edit_categories' => array( 'administrator', 'editor' ),
+ 'delete_categories' => array( 'administrator', 'editor' ),
+ 'manage_post_tags' => array( 'administrator', 'editor' ),
+ 'edit_post_tags' => array( 'administrator', 'editor' ),
+ 'delete_post_tags' => array( 'administrator', 'editor' ),
+ 'edit_css' => array( 'administrator', 'editor' ),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'assign_categories' => array( 'administrator', 'editor', 'author', 'contributor' ),
- 'assign_post_tags' => array( 'administrator', 'editor', 'author', 'contributor' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'assign_categories' => array( 'administrator', 'editor', 'author', 'contributor' ),
+ 'assign_post_tags' => array( 'administrator', 'editor', 'author', 'contributor' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> final private function _getMultiSiteMetaCaps() {
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'create_sites' => array(),
- 'delete_sites' => array(),
- 'manage_network' => array(),
- 'manage_sites' => array(),
- 'manage_network_users' => array(),
- 'manage_network_plugins' => array(),
- 'manage_network_themes' => array(),
- 'manage_network_options' => array(),
- 'setup_network' => array(),
- 'upload_plugins' => array(),
- 'upload_themes' => array(),
- 'edit_css' => array(),
- 'upgrade_network' => array(),
- 'install_languages' => array(),
- 'update_languages' => array(),
- 'deactivate_plugins' => array(),
- 'update_php' => array(),
- 'export_others_personal_data' => array( '' ),
- 'erase_others_personal_data' => array( '' ),
- 'manage_privacy_options' => array(),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'create_sites' => array(),
+ 'delete_sites' => array(),
+ 'manage_network' => array(),
+ 'manage_sites' => array(),
+ 'manage_network_users' => array(),
+ 'manage_network_plugins' => array(),
+ 'manage_network_themes' => array(),
+ 'manage_network_options' => array(),
+ 'setup_network' => array(),
+ 'upload_plugins' => array(),
+ 'upload_themes' => array(),
+ 'edit_css' => array(),
+ 'upgrade_network' => array(),
+ 'install_languages' => array(),
+ 'update_languages' => array(),
+ 'deactivate_plugins' => array(),
+ 'update_php' => array(),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'customize' => array( 'administrator' ),
- 'delete_site' => array( 'administrator' ),
- 'add_users' => array( 'administrator' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'customize' => array( 'administrator' ),
+ 'delete_site' => array( 'administrator' ),
+ 'add_users' => array( 'administrator' ),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'edit_categories' => array( 'administrator', 'editor' ),
- 'delete_categories' => array( 'administrator', 'editor' ),
- 'manage_post_tags' => array( 'administrator', 'editor' ),
- 'edit_post_tags' => array( 'administrator', 'editor' ),
- 'delete_post_tags' => array( 'administrator', 'editor' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'edit_categories' => array( 'administrator', 'editor' ),
+ 'delete_categories' => array( 'administrator', 'editor' ),
+ 'manage_post_tags' => array( 'administrator', 'editor' ),
+ 'edit_post_tags' => array( 'administrator', 'editor' ),
+ 'delete_post_tags' => array( 'administrator', 'editor' ),
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'assign_categories' => array( 'administrator', 'editor', 'author', 'contributor' ),
- 'assign_post_tags' => array( 'administrator', 'editor', 'author', 'contributor' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'assign_categories' => array( 'administrator', 'editor', 'author', 'contributor' ),
+ 'assign_post_tags' => array( 'administrator', 'editor', 'author', 'contributor' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre>
</div>
</div>
</body>
</html>