Option for non-network-admin to view all tickets

We would like a couple of users within the network to view all tickets (not only own tickets) without making them superadmin. Is it possible to assign a capability to these users so they van view all tickets? If so, what cap should we assign? I've already tried manage_options that didn't work.

Thanks in advance!

  • Predrag Dubajic

    Hi Leerpodium,

    Hope you're doing well :slight_smile:

    Easiest way to do is to enable Front End from Support System and add support page on your main site.

    To do this you will need to go to your network admin and under Support > Settings > Front End enable front end pages.
    From there follow the instructions and how to create Support Page with a correct shortcode.
    Now you will have a support page on your main site where your users will be able to see all questions.

    Let us know if that will do the trick for you :slight_smile:

    Best regards,
    Predrag

  • Adam Czajczyk

    Hello Leerpodium

    Thank you for your response and additional explanation.

    This should be doable with a little "tweak" and an additional code. The steps that I tested on my own setup are:

    1. Create an additional WP user role, e.g. using User Role Editor plugin (it can actually be a copy of any existing role just under different name, depending on what other capabilities/permissions those users should have)

    2. For all the non-admin users that should be able to see all tickets - edit their profiles and set that new role for them

    3. In Support System settings set the "Privacy" to "Allow only requestors to see their own tickets"

    5. Add following code as an MU plugin to your site; to do this:

    - create an empty file with a .php extension (e.g. "support-system-non-admin-view-tickets.php")
    - copy&paste this code into it (using some "clean text" editor such as e.g. Notepad++, Sublime or similar):

    <?php
    add_filter( 'support_system_user_can', 'wpmudev_support_system_user_can', 10, 3 );
    
    function wpmudev_support_system_user_can( $user_can, $user_id, $cap ){
    
    global $wpdb;
    $user = get_userdata( $user_id );
    
    $capabilities = $user->{$wpdb->prefix . 'capabilities'};
    
    if ( array_key_exists( 'subscriber', $capabilities ) ) return true;
    
    return $user_can;
    
    }

    - in this line of the code

    if ( array_key_exists( 'subscriber', $capabilities ) ) return true;

    replace subscriber with the name of your new user role (see point 1)

    - save the file and upload it to the "/wp-content/mu-plugins" folder of your site (via FTP or cPanel File Manager).

    This way:

    - those who are allowed to see and open tickets on "Support -> Settings -> General" page in "Permission Settings" section will be able to create new tickets and see their own tickets
    - admins will be able to see all tickets
    - non-admins that are given that custom user role that you created will also be able to see all tickets (like admins)
    - everyone else won't see tickets.

    I hope that helps!

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.