WordPress.org

Make WordPress Core

Changeset 39313


Ignore:
Timestamp:
11/19/16 02:20:08 (7 months ago)
Author:
SergeyBiryukov
Message:

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

See #38857.

Location:
trunk/src/wp-includes/rest-api/endpoints
Files:
4 edited

Legend:

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

    r39257 r39313  
    7979                } 
    8080            } 
    81             return new WP_Error( 'rest_cannot_view', __( 'Sorry, you are not allowed to view this resource with edit context.' ), array( 'status' => rest_authorization_required_code() ) ); 
     81            return new WP_Error( 'rest_cannot_view', __( 'Sorry, you are not allowed to edit posts in this post type.' ), array( 'status' => rest_authorization_required_code() ) ); 
    8282        } 
    8383 
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php

    r39309 r39313  
    7777            } 
    7878 
    79             return new WP_Error( 'rest_cannot_view', __( 'Sorry, you are not allowed to view this resource with edit context.' ), array( 'status' => rest_authorization_required_code() ) ); 
     79            return new WP_Error( 'rest_cannot_view', __( 'Sorry, you are not allowed to edit posts in this post type.' ), array( 'status' => rest_authorization_required_code() ) ); 
    8080        } 
    8181 
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php

    r39309 r39313  
    8282                } 
    8383            } 
    84             return new WP_Error( 'rest_cannot_view', __( 'Sorry, you are not allowed to view this resource with edit context.' ), array( 'status' => rest_authorization_required_code() ) ); 
     84            return new WP_Error( 'rest_cannot_view', __( 'Sorry, you are not allowed to manage terms in this taxonomy.' ), array( 'status' => rest_authorization_required_code() ) ); 
    8585        } 
    8686        return true; 
  • 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.