From 7e883711c3cff48b2ff2558c01f0d0bc68dc8fc8 Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Tue, 21 Jun 2016 14:46:22 +0000 Subject: [PATCH] Revisions: Change the capability needed to view revision diffs to `edit_post`. Merge of [37779] to the 4.1 branch. Built from https://develop.svn.wordpress.org/branches/4.1@37800 git-svn-id: http://core.svn.wordpress.org/branches/4.1@37765 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/ajax-actions.php | 2 +- wp-admin/revision.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 0ee850b95c..3f5cb5819e 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -2575,7 +2575,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/wp-admin/revision.php b/wp-admin/revision.php index f65ae6ae86..23eeeb5fd9 100644 --- a/wp-admin/revision.php +++ b/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