Changeset 39309
- Timestamp:
- 11/19/2016 01:45:30 AM (8 years ago)
- Location:
- trunk/src/wp-includes/rest-api/endpoints
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
r39306 r39309 118 118 119 119 if ( ! empty( $request['context'] ) && 'edit' === $request['context'] && ! current_user_can( 'moderate_comments' ) ) { 120 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to view comments with edit context.' ), array( 'status' => rest_authorization_required_code() ) );120 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit comments.' ), array( 'status' => rest_authorization_required_code() ) ); 121 121 } 122 122 … … 321 321 322 322 if ( ! empty( $request['context'] ) && 'edit' === $request['context'] && ! current_user_can( 'moderate_comments' ) ) { 323 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to view comments with edit context.' ), array( 'status' => rest_authorization_required_code() ) );323 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit comments.' ), array( 'status' => rest_authorization_required_code() ) ); 324 324 } 325 325 -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php
r39304 r39309 128 128 129 129 if ( 'edit' === $request['context'] && ! current_user_can( $obj->cap->edit_posts ) ) { 130 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit this resource.' ), array( 'status' => rest_authorization_required_code() ) );130 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit posts in this post type.' ), array( 'status' => rest_authorization_required_code() ) ); 131 131 } 132 132 -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php
r39304 r39309 142 142 } 143 143 if ( 'edit' === $request['context'] && ! current_user_can( $tax_obj->cap->manage_terms ) ) { 144 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit this resource.' ), array( 'status' => rest_authorization_required_code() ) );144 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to manage terms in this taxonomy.' ), array( 'status' => rest_authorization_required_code() ) ); 145 145 } 146 146 } -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
r39278 r39309 142 142 } 143 143 if ( 'edit' === $request['context'] && ! current_user_can( $tax_obj->cap->edit_terms ) ) { 144 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to view this resource with edit context.' ), array( 'status' => rest_authorization_required_code() ) );144 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ), array( 'status' => rest_authorization_required_code() ) ); 145 145 } 146 146 return true; … … 303 303 } 304 304 if ( 'edit' === $request['context'] && ! current_user_can( $tax_obj->cap->edit_terms ) ) { 305 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to view this resource with edit context.' ), array( 'status' => rest_authorization_required_code() ) );305 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ), array( 'status' => rest_authorization_required_code() ) ); 306 306 } 307 307 return true; -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
r39304 r39309 149 149 150 150 if ( 'edit' === $request['context'] && ! current_user_can( 'list_users' ) ) { 151 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to view this resource with edit context.' ), array( 'status' => rest_authorization_required_code() ) );151 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit users.' ), array( 'status' => rest_authorization_required_code() ) ); 152 152 } 153 153
Note: See TracChangeset
for help on using the changeset viewer.