Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further harden who=authors check by author support for post type #6548

Merged
merged 1 commit into from
May 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Further harden who=authors check by author support for post type
  • Loading branch information
danielbachhuber committed May 2, 2018
commit 8736fed5f37d8e1beea3eb09796d92e0ac880e19
3 changes: 2 additions & 1 deletion lib/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ function gutenberg_handle_early_callback_checks( $response, $handler, $request )
$can_view = false;
$types = get_post_types( array( 'show_in_rest' => true ), 'objects' );
foreach ( $types as $type ) {
if ( current_user_can( $type->cap->edit_posts ) ) {
if ( post_type_supports( $type->name, 'author' )
&& current_user_can( $type->cap->edit_posts ) ) {
$can_view = true;
}
}
Expand Down