Support » Plugin: Easy Appointments » Administrator can view reports but no other roles can

  • Is there a way to allow editors (or other roles) to have access to the reports page?

    Specifically the Time Table.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I don’t know if there is a hook or another more elegant way to do that, the only solution I can offer you is to manually change the plugin code. Attention: This has to be redone after every update of the plugin!

    You have to change the access rights which are limited to admins at line 790 of ajax_report function of wp-content/plugins/easy_appointsments/src/ajax.php from:

    $this->validate_access_rights();

    To this:

    $this->validate_access_rights_editor();

    Then you have to define this new function:

    private function validate_access_rights_editor()
    {
        if (!current_user_can( 'edit_pages' )) {
            header('HTTP/1.1 403 Forbidden');
            die('You don\'t have rights for this action');
        }
    }
    • This reply was modified 2 years, 8 months ago by Gerald.
    • This reply was modified 2 years, 8 months ago by Gerald.
    Thread Starter heebyjeeb09

    (@heebyjeeb09)

    Awesome!

    Thanks Gerital.

    I will have a play.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Administrator can view reports but no other roles can’ is closed to new replies.