Title: WP_REST_Blocks_Controller::check_read_permission
Published: December 6, 2018
Last modified: May 20, 2026

---

# WP_REST_Blocks_Controller::check_read_permission( WP_Post $post ): bool

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_rest_blocks_controller/check_read_permission/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_rest_blocks_controller/check_read_permission/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_rest_blocks_controller/check_read_permission/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_rest_blocks_controller/check_read_permission/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_rest_blocks_controller/check_read_permission/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_rest_blocks_controller/check_read_permission/?output_format=md#wp--skip-link--target)

Checks if a pattern can be read.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_rest_blocks_controller/check_read_permission/?output_format=md#parameters)󠁿

 `$post`[WP_Post](https://developer.wordpress.org/reference/classes/wp_post/)required

Post object that backs the block.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_rest_blocks_controller/check_read_permission/?output_format=md#return)󠁿

 bool Whether the pattern can be read.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_rest_blocks_controller/check_read_permission/?output_format=md#source)󠁿

    ```php
    public function check_read_permission( $post ) {
    	// By default the read_post capability is mapped to edit_posts.
    	if ( ! current_user_can( 'read_post', $post->ID ) ) {
    		return false;
    	}

    	return parent::check_read_permission( $post );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-blocks-controller.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/rest-api/endpoints/class-wp-rest-blocks-controller.php#L30)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/rest-api/endpoints/class-wp-rest-blocks-controller.php#L30-L37)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_rest_blocks_controller/check_read_permission/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_REST_Posts_Controller::check_read_permission()](https://developer.wordpress.org/reference/classes/wp_rest_posts_controller/check_read_permission/)`wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php` |

Checks if a post can be read.

  | 
| [current_user_can()](https://developer.wordpress.org/reference/functions/current_user_can/)`wp-includes/capabilities.php` |

Returns whether the current user has the specified capability.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_rest_blocks_controller/check_read_permission/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_rest_blocks_controller%2Fcheck_read_permission%2F)
before being able to contribute a note or feedback.