Make WordPress Core


Ignore:
Timestamp:
11/19/2016 02:20:08 AM (10 years ago)
Author:
SergeyBiryukov
Message:

REST API: Merge some more permission error strings missed in [39309].

See #38857.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

    r39312 r39313  
    321321
    322322                if ( 'edit' === $request['context'] && ! current_user_can( 'list_users' ) ) {
    323                         return new WP_Error( 'rest_user_cannot_view', __( 'Sorry, you are not allowed to view this resource with edit context.' ), array( 'status' => rest_authorization_required_code() ) );
     323                        return new WP_Error( 'rest_user_cannot_view', __( 'Sorry, you are not allowed to list users.' ), array( 'status' => rest_authorization_required_code() ) );
    324324                } elseif ( ! count_user_posts( $id, $types ) && ! current_user_can( 'edit_user', $id ) && ! current_user_can( 'list_users' ) ) {
    325                         return new WP_Error( 'rest_user_cannot_view', __( 'Sorry, you are not allowed to view this resource.' ), array( 'status' => rest_authorization_required_code() ) );
     325                        return new WP_Error( 'rest_user_cannot_view', __( 'Sorry, you are not allowed to list users.' ), array( 'status' => rest_authorization_required_code() ) );
    326326                }
    327327
Note: See TracChangeset for help on using the changeset viewer.