return $post;
} if ( 'edit' ===
$request['context'
] &&
$post && !
$this->
check_update_permission( $post ) ) { return new WP_Error( 'rest_forbidden_context',
__( 'Sorry, you are not allowed to edit this global style.'
),
array
( 'status' =>
rest_authorization_required_code() ) );
} if ( !
$this->
check_read_permission( $post ) ) { return new WP_Error( 'rest_cannot_view',
__( 'Sorry, you are not allowed to view this global style.'
),
array
( 'status' =>
rest_authorization_required_code() ) );
} return true;
} /**
* Checks if a global style can be read.
*
* @since 5.9.0
*
* @param WP_Post $post Post object.
* @return bool Whether the post can be read.
*/