From f28d567989e7795a39188dece58b15a0541090dd Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Tue, 21 Jun 2016 14:19:26 +0000 Subject: [PATCH] Revisions: Change the capability needed to view revision diffs to `edit_post`. git-svn-id: https://develop.svn.wordpress.org/trunk@37779 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/ajax-actions.php | 2 +- src/wp-admin/revision.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index bcd1825332..1864d878ac 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -2778,7 +2778,7 @@ function wp_ajax_get_revision_diffs() { if ( ! $post = get_post( (int) $_REQUEST['post_id'] ) ) wp_send_json_error(); - if ( ! current_user_can( 'read_post', $post->ID ) ) + if ( ! current_user_can( 'edit_post', $post->ID ) ) wp_send_json_error(); // Really just pre-loading the cache here. diff --git a/src/wp-admin/revision.php b/src/wp-admin/revision.php index 4d86c536b9..d63b26bbf9 100644 --- a/src/wp-admin/revision.php +++ b/src/wp-admin/revision.php @@ -63,7 +63,7 @@ default : if ( ! $post = get_post( $revision->post_parent ) ) break; - if ( ! current_user_can( 'read_post', $revision->ID ) || ! current_user_can( 'read_post', $post->ID ) ) + if ( ! current_user_can( 'read_post', $revision->ID ) || ! current_user_can( 'edit_post', $revision->post_parent ) ) break; // Revisions disabled and we're not looking at an autosave