• Hi,

    I have on admin page called “download_report”, and I want users with the Editor role to be able to download reports. Currently, it throws a “you do not have permission” error when an Editor tries to access the page.

    I’ve already created a function that allows Editors to see the Icegram plugin, and i tried to extend also this page but no result. I just need guidance on how to allow Editors to access this custom admin page and download reports.

    Here is my code

    add_filter('user_has_cap', function ($all_caps, $caps, $args, $user) {

        if (empty($user->roles) || !in_array('editor', (array) $user->roles, true)) {

            return $all_caps;

        }

        // Icegram Express page slugs

        $ig_es_pages = [

            'es_dashboard', 'es_lists', 'es_forms', 'es_campaigns', 'es_notifications',

            'es_newsletters', 'es_workflows', 'es_reports', 'es_logs', 'es_settings',

            'es_general_information', 'es_pricing', 'es_gutenberg_editor'

        ];

        $page      = isset($_GET['page']) ? sanitize_text_field($_GET['page']) : '';

        $post_type = isset($_GET['post_type']) ? sanitize_text_field($_GET['post_type']) : '';

        $on_icegram_screen = ($page && in_array($page, $ig_es_pages, true)) ||

                             ($post_type && strpos($post_type, 'ig_es_') === 0);

        // 1) Grant on actual Icegram requests

        if ($on_icegram_screen) {

            $all_caps['manage_options'] = true;

            return $all_caps;

        }

        // 2) Also grant during admin menu build so the Icegram menu shows up

        // (but we'll hide global Settings right after).

        if (is_admin() && doing_action('admin_menu')) {

            $all_caps['manage_options'] = true;

        }

        return $all_caps;

    }, 10, 4);

    Thanks in advance for any help!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi @gioiliop7,

    Thanks for contacting us!

    To better understand your queries, could you please tell us which plan you are using of the Icegram Express plugin?

    Additionally, as per your requirement, if you are an admin of the plugin, you can give the permission to the editor to download the report and any other data access from the plugin. For this, just go to Icegram Express -> Settings -> Access Control and then set up the permission for other role users. Additionally, please note that the Access Control is a paid feature of the plugin

    For your reference, please see the attached screenshot below.

    Settings-‹-Icegram-Express-Demo-—-WordPress-09-11-2025_05_27_PM.jpg

    Waiting for your further input!

    • This reply was modified 8 months, 2 weeks ago by Anupam Khatua.
    Thread Starter Giorgos Iliopoulos

    (@gioiliop7)

    Hello.

    I know that there is settings for admin. I want to extend this into also for editors.

    Is there any hook?

    I use the free version of plugin.

    Thank you

    Hi @gioiliop7,

    Thank you for your reply! I apologize for the delayed response due to the weekend holiday.

    I have shared your concern with my technical team, and they will look into it as a priority. I will update you as soon as possible once they get back to me.

    Best wishes.

    Hi @gioiliop7,

    Thank you for your patience and support!

    Based on your requirements, you can use this hook apply_filters( 'ig_es_can_access', $can_access, $page ); to grant access to the editor role for users who want to report page access.

    I hope this solution works for you. If you encounter any further issues, please let me know.

    Plugin Contributor Shubhanshu Kandani

    (@shubhanshukandani)

    Hi @gioiliop7,
    Hope you’re doing great.

    I wanted to check in with you regarding the inquiry you had the other day. Was it resolved? Do you need any additional help? I’d be happy to assist you in any case.

    Thank you!
    Have a great day ahead.

    Thread Starter Giorgos Iliopoulos

    (@gioiliop7)

    Oh i haven’t been notified about the answer. My apologies.

    I will try it and i will come back about the result.

    Thank you

    Thread Starter Giorgos Iliopoulos

    (@gioiliop7)

    @anupamkhatua just use the hook or make a function on it as i sent above?

    Hi @gioiliop7,

    Referring to your concern, you can use it as an external hook to fetch the function.

    Let us know if you have any further question.

    Plugin Contributor Shubhanshu Kandani

    (@shubhanshukandani)

    Hi @gioiliop7,

    Just checking in to see if you had a chance to try the suggested solution using it as an external hook to fetch the function.

    Please let us know if it worked for you or if you have any further questions. We’ll be happy to help.

    Anupam Khatua

    (@anupamkhatua)

    Hi @gioiliop7,

    Hope you’re doing great.

    I wanted to check in with you regarding the inquiry you had the other day. Was it resolved? Do you need any additional help? I’d be happy to assist you in any case.

    Thank you!
    Have a great day ahead.

    Anupam Khatua

    (@anupamkhatua)

    Hi @gioiliop7,

    Since we haven’t received a response in a while, I’m closing this thread for now. Please feel free to reopen it if you still have any issues or questions related to the plugin.

    Also if you have any other queries, you can open a new thread from here. We will be happy to assist you further.

    Thank you!

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Allow editor for reports’ is closed to new replies.