Support » Plugin: Contact Form Advanced Database » Capability stuck on administrator user role only for export.

  • Hello,

    Your plugin works very well. Thanks.
    I use User Role Editor plugin in combination with Adminimize plugin to create some admins roles with some restricted access.
    With your plugin, any user role that have ‘manage_options’ capability can have access to Contact Form Advanced Database backend page. But the only user role that can export is ‘administrator’. Those two things are define in the main php file of your plugin cf7_adb.class.php at line 73.
    The first one at line 22:

    function renderGUI(){
    	add_submenu_page( 'wpcf7','Contact Form Advanced Database','Contact Form Advanced Database', 'manage_options', 'cf7-adb', array($this,'renderBackend') );
    }

    and the second one at line 71:

    function cf7AdbExportController() {
    	// filename for download\
    	$hook = add_submenu_page(null, '', '', 'manage_options', 'cf7-adb-export-xls', function(){});
    …/…

    Looking at wordpress documentation related to add_submenu_page() function the fourth parameter is normaly a capability (not a user role).

    So i have change, in the second one ‘administrator’ parameter with ‘manage_options’ and now a user role who has ‘manage_options’ capability can export.

    My question: Is this done on purpose to restrict export process to administrator user role only, or is it a mistake.

    Thanks and regards.

    https://wordpress.org/plugins/contact-form-advanced-database/

Viewing 1 replies (of 1 total)
  • Some errors when posting this (impossible to edit my post):

    Update:
    The file path in the plugin is lib/cf7_adb.class.php

    Before modificating code (line 71):

    function cf7AdbExportController() {
    	// filename for download\
    	$hook = add_submenu_page(null, '', '', 'administrator', 'cf7-adb-export-xls', function(){});
    …/…

    The modification i have made is at line 73:

    $hook = add_submenu_page(null, '', '', 'manage_options', 'cf7-adb-export-xls', function(){});

    Regards

Viewing 1 replies (of 1 total)
  • The topic ‘Capability stuck on administrator user role only for export.’ is closed to new replies.