Since version 2.3.16, developper added a security check based on the “manage_options” capability into the file “rgg-options.php”.
Because of this, users that doesn’t have this capability (all but administrators) may encounter the message “You do not have sufficient permissions to access this page.”
From version 2.3.16, for best practice the developper should implement a “Role Management” section into the RGG settings panel, and accordingly adapt the security check added in “rgg-options.php” (since version 2.3.16).
Here is a Fix in case your users face “You do not have sufficient permissions to access this page.” in the WordPress Dashboard.
- Find the WordPress capability that is common to the different users who must access to the WordPress Dashboard.
eg: “manage_woocommerce” if users have the “Shop Manager” role
eg: “edit_page” if users have the “Editor” role
eg: “read” if users have the “Subscriber” role
- Add the code below into the functions.php file of your child theme
(replace the below bold capability with the one depending your case)
remove_action('admin_init', 'rgg_admin_init');
add_action('admin_init', 'FIX_rgg_admin_init');
function FIX_rgg_admin_init(){
if (!current_user_can('manage_woocommerce')) {
wp_die('You do not have sufficient permissions to access this page.');
}
register_setting( RGG_OPTIONS, RGG_OPTIONS, 'rgg_options_sanitize' );
add_settings_section('rgg_main', 'Main Settings', 'rgg_section_text', RGG_PLUGIN);
add_settings_field('rgg_text_string', 'Plugin Text Input', 'rgg_setting_string', RGG_PLUGIN, 'rgg_main');
}