• Resolved Bru

    (@brunobrbr)


    Hello how are you? Would you help me? How to let another user level access the plugin?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Knut Sparhell

    (@knutsp)

    Two ways, depending:

    1. Restricted access, user only se own email account, for users who have an account under the website’s domain: With a roles/capabilities plugin, grant access to custom capability ‘cpanel’. Will not work if user has foreign email account, like x@gmail, x@hotmail etc.

    2. Full access. As stated on the description page for this plugin:

    Option to allow other users than those with manage_options capability to manage email adresses, single- or multisite, one of following

    add_filter( ‘wf_cpanel_email_capability’, static fn( string $cap ) => $my_cpanel_email_cap );
    add_filter( ‘wf_cpanel_email_capability’, static fn( string $cap ) => ‘edit_published_pages’ );

    So, if $my_cpanel_email_cap is 'edit_posts', anyone from contributor role and up will have access (to all). But 'edit_published_pages' will give only Edtors access. See Roles and Capabilities for details.

    You put either in functions.php of your child theme (if you use a child theme) or, better, in a custom plugin for your site and for this plugin. A custom plugin is a PHP file in plugins, or a subfolder, with this header:

    /**
    * Plugin Name: My Customize Email Accounts plugin name
    */

    the wanted PHP code below the header, and activate it in Plugins.

    • This reply was modified 2 years, 6 months ago by Knut Sparhell.
    Thread Starter Bru

    (@brunobrbr)

    Okay, if I change here to the role I want you to have access to, is that okay?
    I put it here and it worked, will I have any security issues?
    Because the idea is that everyone in the defined function has access to the plugin, the site here is unique

    <?php
    /*
    Plugin Name: Plugin Email
    Plugin URI:
    Description:
    Version:
    Author:
    Author URI:
    */
    
    add_filter( 'wf_cpanel_email_capability', static fn( string $cap ) => 'Role here

    ‘ );

    Thread Starter Bru

    (@brunobrbr)

    Ok, se eu mudar aqui para o papel que eu quero que você tenha acesso, tudo bem?
    Coloquei aqui e funcionou, terei algum problema de seguran?a?
    Como a ideia é que todos na fun??o definida tenham acesso ao plugin, o site aqui é único

    <?php
    /*
    Plugin Name: Plugin Email
    Plugin URI:
    Description:
    Version:
    Author:
    Author URI:
    */
    add_filter( 'wf_cpanel_email_capability', static fn( string $cap ) => 'Role here' );
    
    
    Thread Starter Bru

    (@brunobrbr)

    **

    Okay, if I change here to the role I want you to have access to, is that okay?
    I put it here and it worked, will I have any security issues?
    Because the idea is that everyone in the defined function has access to the plugin, the site here is unique

    <?php
    /*
    Plugin Name: Plugin Email
    Plugin URI:
    Description:
    Version:
    Author:
    Author URI:
    */
    add_filter( 'wf_cpanel_email_capability', static fn( string $cap ) => 'Role here' );
    
    Plugin Author Knut Sparhell

    (@knutsp)

    The returned cap should be a capability, but role may magically work there, but deprecated. it goes to current_user_can function.

    Every user with a role that contains that capability will have access to all e-mail accounts on the hosting cPanel account. Use a cap unique to a role that only trusted users get, like ‘edit_published_posts’ for Editor+Administrator.

    If more domains on same cPanel, it can be limited to site domain y another filter.

    Plugin Author Knut Sparhell

    (@knutsp)

    Did you solve this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Other Users access emails’ is closed to new replies.