Make WordPress Core


Ignore:
Timestamp:
02/11/2020 06:34:08 PM (7 years ago)
Author:
SergeyBiryukov
Message:

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 #44176.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/capabilities.php

    r47219 r47269  
    133133                         */
    134134                        if ( (int) get_option( 'wp_page_for_privacy_policy' ) === $post->ID ) {
    135                                 $caps = array_merge( $caps, map_meta_cap( 'manage_privacy_options', $user_id ) );
     135                                $caps[] = 'manage_privacy_options';
    136136                        }
    137137
    … …  
    204204                         */
    205205                        if ( (int) get_option( 'wp_page_for_privacy_policy' ) === $post->ID ) {
    206                                 $caps = array_merge( $caps, map_meta_cap( 'manage_privacy_options', $user_id ) );
     206                                $caps[] = 'manage_privacy_options';
    207207                        }
    208208
    … …  
    581581                        }
    582582                        break;
    583                 case 'export_others_personal_data':
    584                 case 'erase_others_personal_data':
    585                 case 'manage_privacy_options':
    586                         $caps[] = is_multisite() ? 'manage_network' : 'manage_options';
    587                         break;
    588583                default:
    589584                        // Handle meta capabilities for custom post types.
Note: See TracChangeset for help on using the changeset viewer.