|
@@ 20-30 (lines=11) @@
|
| 17 |
|
* @param WP_REST_Request $request Full details about the request. |
| 18 |
|
* @return WP_Error|boolean |
| 19 |
|
*/ |
| 20 |
|
public function get_items_permissions_check( $request ) { |
| 21 |
|
if ( ! is_user_member_of_blog( get_current_user_id(), get_current_blog_id() ) ) { |
| 22 |
|
return new WP_Error( |
| 23 |
|
'rest_cannot_view', |
| 24 |
|
esc_html__( 'Sorry, you cannot view this resource.', 'jetpack' ), |
| 25 |
|
array( 'status' => 401 ) |
| 26 |
|
); |
| 27 |
|
} |
| 28 |
|
|
| 29 |
|
return true; |
| 30 |
|
} |
| 31 |
|
|
| 32 |
|
/** |
| 33 |
|
* Check whether a given request has proper authorization to view feedback item. |
|
@@ 38-48 (lines=11) @@
|
| 35 |
|
* @param WP_REST_Request $request Full details about the request. |
| 36 |
|
* @return WP_Error|boolean |
| 37 |
|
*/ |
| 38 |
|
public function get_item_permissions_check( $request ) { |
| 39 |
|
if ( ! is_user_member_of_blog( get_current_user_id(), get_current_blog_id() ) ) { |
| 40 |
|
return new WP_Error( |
| 41 |
|
'rest_cannot_view', |
| 42 |
|
esc_html__( 'Sorry, you cannot view this resource.', 'jetpack' ), |
| 43 |
|
array( 'status' => 401 ) |
| 44 |
|
); |
| 45 |
|
} |
| 46 |
|
|
| 47 |
|
return true; |
| 48 |
|
} |
| 49 |
|
|
| 50 |
|
} |
| 51 |
|
|