- Timestamp:
- 11/15/2016 10:22:33 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
r39223 r39257 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 cannotview 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 view this resource with edit context.' ), 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 cannotview 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 view this resource with edit context.' ), array( 'status' => rest_authorization_required_code() ) ); 306 306 } 307 307 return true; … … 351 351 $taxonomy_obj = get_taxonomy( $this->taxonomy ); 352 352 if ( ! current_user_can( $taxonomy_obj->cap->manage_terms ) ) { 353 return new WP_Error( 'rest_cannot_create', __( 'Sorry, you cannotcreate new resource.' ), array( 'status' => rest_authorization_required_code() ) );353 return new WP_Error( 'rest_cannot_create', __( 'Sorry, you are not allowed to create new resource.' ), array( 'status' => rest_authorization_required_code() ) ); 354 354 } 355 355 … … 458 458 459 459 if ( ! current_user_can( 'edit_term', $term->term_id ) ) { 460 return new WP_Error( 'rest_cannot_update', __( 'Sorry, you cannotupdate resource.' ), array( 'status' => rest_authorization_required_code() ) );460 return new WP_Error( 'rest_cannot_update', __( 'Sorry, you are not allowed to update resource.' ), array( 'status' => rest_authorization_required_code() ) ); 461 461 } 462 462 … … 547 547 548 548 if ( ! current_user_can( 'delete_term', $term->term_id ) ) { 549 return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you cannotdelete resource.' ), array( 'status' => rest_authorization_required_code() ) );549 return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete resource.' ), array( 'status' => rest_authorization_required_code() ) ); 550 550 } 551 551
Note: See TracChangeset
for help on using the changeset viewer.