Admin Access Control to Plugin

Hi

We have installed the plugin and it works well - however we are an admin and can access it and our client is an editor. When they login to the admin area they can't see the Popup Pro plugin from the menu to add and deactivate a plugin.

We don't want to give them access as an administrator as they will likely change a lot of settings.

Can you advise what to do? Do you have a plugin to provide access controls or something or advise code wise what to do as we really need them to access it as an editor.

Thanks

Olly

  • Vaughan
    • Support/SLS MockingJay

    Hi Olly,

    Hope you're well?

    I haven't tested this but it should allow you to change the access role.

    Currently it is set as default to manage_options

    So we should be able tochange this to the following:

    Add the following to your theme functions.php

    add_filter( 'popover-admin-access-capability', 'wpmudev_popover_custom_access' );
    function wpmudev_popover_custom_access() {
        return 'manage_links';
    }

    That should hopefully give editors and above access.

    Hope this helps

  • Vaughan
    • Support/SLS MockingJay

    Hi,

    That's extremely weird. I just tried it on my site and it even prevents admins from accessing it.

    manage_links is a valid editor/admin capability though according to wp codex. https://codex.wordpress.org/Roles_and_Capabilities

    However, all is not lost.

    delete_pages is an editor & admin capability only and that does work, so instead of the above, try the following.

    add_filter( 'popover-admin-access-capability', 'wpmudev_popover_custom_access', 999 );
    function wpmudev_popover_custom_access() {
        return 'delete_pages';
    }

    I've tested this and it does work :slight_smile:

    Hope this helps

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.