• I’ve searched everywhere to try and find the capability option in “User Role Editor” that controls a user being able to view permissions.
    Every time we try to view revisions by moving the selector to a previous revision as a restricted user we get the error

    Sorry, something went wrong. The requested comparison could not be loaded.

    If I login with a real admin account, it works just fine.
    The editor role we have created has full editing and publishing rights.

    Does anyone know with setting controls them being able to view Revisions?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter SimonNWalker

    (@simonnwalker)

    Does anyone have any advice on this ?

    Thread Starter SimonNWalker

    (@simonnwalker)

    It would really be great if I could get some help with this.
    THanks

    Thread Starter SimonNWalker

    (@simonnwalker)

    @shinephp is there any chance we could get some assistance on this question?

    Plugin Author Vladimir Garagulya

    (@shinephp)

    There is no a special user capability for this case. All data are loaded together with the page itself at once. Then JavaScript code from wp-admin/js/revisions.js file works. Look via browser JavaScript console if any JavaScript error are shown there.

    Thread Starter SimonNWalker

    (@simonnwalker)

    Yes, There is an AJAX error, but only for the restricted editor users.
    I tried to copy the error from the console….

    POST https://www.bentleybaths.com/wp-admin/admin-ajax.php 403 (Forbidden) load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils&ver=69831ad…:4

    Any ides ?
    Is there another access right I need to give them?

    Thread Starter SimonNWalker

    (@simonnwalker)

    Hi Vladimir,
    Did you see my reply with error?
    Thanks
    Simon

    Plugin Author Vladimir Garagulya

    (@shinephp)

    Hi Simon,

    Could you show more information? If you click on the row with 403 error, then you may see in console what request was sent to the server, what parameters, data. May be it will help to understand a reason of this error.
    Like this one made from the Network tab of the Google Chrome JavaScript console:
    AJAX: compare revisions
    Open image source in a new tab to view it in a full size.

    Thread Starter SimonNWalker

    (@simonnwalker)

    See if these help.


    Plugin Author Vladimir Garagulya

    (@shinephp)

    I don’t see from where WordPress can send “403 Forbidden” for this request. If user does not have some permissions then you should get success:false response, which is not “403 Forbidden”.

    Server should execute for this request:
    1) wp-admin/admin-ajax.php
    2) wp-admin/includes/ajax-actions.php:wp_ajax_get_revision_diffs()

    So you may try to trace is this 403 comes from PHP code or from your web server.
    Start from adding to the begin of admin-ajax.php:

    
    if ( ! empty( $_POST['action'] ) && ( $_POST['action'] == 'get-revision-diffs' ) {
      echo 'Test output from WP';
      die(0);
    }
    

    If you still get 403 error a problem is not related to WordPress, find it in a Web Server. May be logs will help.

    If you will see test output, then try to move it step by step , e.g. check:
    – if wp_ajax_get_revision_diffs() is executed
    – if action line #91

    
    do_action( 'wp_ajax_' . $_REQUEST['action'] );
    

    is executed, etc. I hope you got a general idea:
    Try to isolate a place in the code which responses with 403. Then you may analyse – why.

    Thread Starter SimonNWalker

    (@simonnwalker)

    Vladimir,

    So I wanted to give you an update and it would appear that this error is related somehow to the new Firewall feature of WordFence.
    I was going through more debugging as you suggested but was slowly getting beyond my capabilities.
    So I started disabling plugins and finally tracked it down to WordFence.
    I had to put the WordFence firewall back into learning mode, go through the steps to recreate the error and then turn learning mode back off. Once this was done, it appears to be working.
    Thanks for your help with this.

    Simon

    Plugin Author Vladimir Garagulya

    (@shinephp)

    Hi Simon,

    Thanks for sharing this information.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Capability for Viewing Page Revisions’ is closed to new replies.