• Resolved edival

    (@edival)


    Does anyone know of a way to allow non-Admin users access to this plugin? I’ve tried adding in Role manager plugins but it doesn’t seem to allow access.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi @edival,

    All of the capabilities for this plugin are tied to the manage_options capability (an admin-only capability). In almost all places, this capability can be changed with a filter.

    For example, if you want to editors to be able to access parts of this plugin, use this code snippet. (The manage_links capability is only for Editors and Admins).

    add_filter( 'yikes-mailchimp-user-role-access', 'yikes_mailchimp_change_user_role', 10, 1 );
    
    function yikes_mailchimp_change_user_role( $cap ) {
        return 'manage_links';
    }

    For more information about capabilities for different roles, check out this article: https://codex.www.ads-software.com/Roles_and_Capabilities.

    Let me know if you need any help applying this custom code.

    Thank you,
    Kevin.

    Thread Starter edival

    (@edival)

    Hi Kevin,

    That sounds super simple.

    I tried applying that code to my functions.php but it didn’t seem to make a difference aside from hiding Easy Forms from the admin ??

    I appreciate the quick feedback.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Haha well that’s how it’s supposed to work. I just tried it out and manage_links is a wrong capability.

    Which roles are you looking to enable it for?

    return 'publish_posts'; Should work for Authors, Editors, and Admins.

    return 'read'; Should work for all user roles.

    return 'unfiltered_html'; Should work for Editors and Admins.

    Note that some of these won’t work in multisite configurations.

    Thread Starter edival

    (@edival)

    Ahh, okay.

    I’d like Editors to have access to view, create, edit and duplicate the forms:
    /wp-admin/admin.php?page=yikes-inc-easy-mailchimp

    And view the mailing lists: /wp-admin/admin.php?page=yikes-inc-easy-mailchimp-lists

    And that should do it ??

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi @edival,

    Were you able to work that out? Do you have the capabilities working as you’d like them?

    Let us know.

    Thank you,
    Kevin.

    Thread Starter edival

    (@edival)

    Hi Kevin,

    No, I haven’t had the chance yet. Do you have a simple solution? ??

    Thanks so much.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hello,

    Unfortunately a filter function is the only way to do it. For editors & admins, that would look like this:

    add_filter( 'yikes-mailchimp-user-role-access', 'yikes_mailchimp_change_user_role', 10, 1 );
    
    function yikes_mailchimp_change_user_role( $cap ) {
        return 'unfiltered_html';
    }
    Thread Starter edival

    (@edival)

    Hi Kevin,

    Thanks,

    I’ll play with this ??

    Thread Starter edival

    (@edival)

    Hi Kevin,

    That’s the one, that’s all the features, but it works perfectly! I’ll have to remember that bit of code.

    Thanks so much.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi @edival,

    Yeah – sorry – we don’t have our permissions broken up as you wanted; it’s all or nothing.

    I’m glad that’ll work for you though.

    Cheers,
    Kevin.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Allow non-admin roles access’ is closed to new replies.