WordPress.org

Make WordPress Core

Ticket #43935: 43935.diff

File 43935.diff, 2.7 KB (added by iandunn, 3 years ago)
  • src/wp-admin/menu.php

    diff --git src/wp-admin/menu.php src/wp-admin/menu.php
    index 51d9cac1a8..0030bd4da7 100644
    $menu[75] = array( __( 'Tools' ), 'edit_posts', 'tools.php', 
    256256        $submenu['tools.php'][5]  = array( __( 'Available Tools' ), 'edit_posts', 'tools.php' );
    257257        $submenu['tools.php'][10] = array( __( 'Import' ), 'import', 'import.php' );
    258258        $submenu['tools.php'][15] = array( __( 'Export' ), 'export', 'export.php' );
    259         $submenu['tools.php'][20] = array( __( 'Privacy' ), 'manage_options', 'privacy.php' );
     259        $submenu['tools.php'][20] = array( __( 'Privacy' ), 'manage_privacy_policy', 'privacy.php' );
    260260if ( is_multisite() && ! is_main_site() ) {
    261261        $submenu['tools.php'][25] = array( __( 'Delete Site' ), 'delete_site', 'ms-delete-site.php' );
    262262}
  • src/wp-admin/privacy.php

    diff --git src/wp-admin/privacy.php src/wp-admin/privacy.php
    index 1d17f0f5f0..23203f8bc9 100644
     
    99/** WordPress Administration Bootstrap */
    1010require_once( dirname( __FILE__ ) . '/admin.php' );
    1111
    12 if ( ! current_user_can( 'manage_options' ) ) {
     12if ( ! current_user_can( 'manage_privacy_policy' ) ) {
    1313        wp_die( __( 'Sorry, you are not allowed to manage privacy on this site.' ) );
    1414}
    1515
  • src/wp-includes/capabilities.php

    diff --git src/wp-includes/capabilities.php src/wp-includes/capabilities.php
    index efc3dd2e4c..eb7ee7b138 100644
    function map_meta_cap( $cap, $user_id ) { 
    557557                        break;
    558558                case 'export_others_personal_data':
    559559                case 'erase_others_personal_data':
     560                case 'manage_privacy_policy':
    560561                        $caps[] = is_multisite() ? 'manage_network' : 'manage_options';
    561562                        break;
    562563                default:
  • tests/phpunit/tests/user/capabilities.php

    diff --git tests/phpunit/tests/user/capabilities.php tests/phpunit/tests/user/capabilities.php
    index 7b086d1384..9e8d5d78fa 100644
    class Tests_User_Capabilities extends WP_UnitTestCase { 
    239239                        'upgrade_php'            => array( 'administrator' ),
    240240                        'export_others_personal_data' => array( 'administrator' ),
    241241                        'erase_others_personal_data'  => array( 'administrator' ),
     242                        'manage_privacy_policy'       => array( 'administrator' ),
    242243
    243244                        'edit_categories'        => array( 'administrator', 'editor' ),
    244245                        'delete_categories'      => array( 'administrator', 'editor' ),
    class Tests_User_Capabilities extends WP_UnitTestCase { 
    273274                        'upgrade_php'            => array(),
    274275                        'export_others_personal_data' => array( '' ),
    275276                        'erase_others_personal_data'  => array( '' ),
     277                        'manage_privacy_policy'       => array(),
    276278
    277279                        'customize'              => array( 'administrator' ),
    278280                        'delete_site'            => array( 'administrator' ),