[wp-trac] [WordPress Trac] #40577: Introduce a capability for viewing the revisions of a post
WordPress Trac
noreply at wordpress.org
Wed Jul 1 21:29:31 UTC 2020
#40577: Introduce a capability for viewing the revisions of a post
-------------------------------------+-------------------------------------
Reporter: johnbillion | Owner: adamsilverstein
Type: enhancement | Status: assigned
Priority: normal | Milestone: Future Release
Component: Revisions | Version: 2.6
Severity: normal | Resolution:
Keywords: needs-unit-tests | Focuses: administration, rest-
granular-capabilities needs-patch | api
-------------------------------------+-------------------------------------
Comment (by charveyunm):
Replying to [comment:12 charveyunm]:
> Just found this issue and wanted to add that my team is looking for this
exact functionality (allowing users who don't have permissions to publish
items to view revision history for accountability/historical reasons). Are
there any updates on when this might be added since it got taken out of
the 5.4 release?
Besides the noted change in the revisions.php code mentioned above - I
believe altering the function wp_ajax_get_revision_diffs in ajax-
actions.php would provide most of what our team needs.
something like:
{{{
if ( ! current_user_can( 'edit_post', $post->ID ) || !
current_user_can('read_revision', $post->ID) ) {
wp_send_json_error();
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40577#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list