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