Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

Don't forcibly downgrade context in WP_REST_Users_Controller::get_items() #1869

Description

@danielbachhuber

In WP_REST_Users_Controller::get_items(), we forcibly downgrade context if the user doesn't have list_users capability:

if ( ! current_user_can( 'list_users' ) ) {
    $prepared_args['has_published_posts'] = true;

    // Only display a public subset of information
    $request['context'] = 'embed';
}

This is inconsistent with the rest of our controllers. If the current user can't access the supplied context, we should return an error.

Related #1845

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions