Other Users access emails
-
Hello how are you? Would you help me? How to let another user level access the plugin?
-
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_capis'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.phpof 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 inplugins, 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 4 years, 1 month ago by
Knut Sparhell.
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‘ );
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' );**
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' );The returned cap should be a capability, but role may magically work there, but deprecated. it goes to
current_user_canfunction.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.
Did you solve this?
-
This reply was modified 4 years, 1 month ago by
The topic ‘Other Users access emails’ is closed to new replies.