Title: Configurable capability
Last modified: August 21, 2016

---

# Configurable capability

 *  [Pionect](https://wordpress.org/support/users/pionect/)
 * (@pionect)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/configurable-capability/)
 * We have a site with specific configured user roles.
    Our ‘admins’ aren’t allowed
   to change plugins but need access to this export plugin. It would be nice if 
   you’d change the capability ‘edit_plugins’ to a more dynamic solution.
 * I can recommend this tutorial:
    [justintadlock.com | custom capabilities in plugins](http://justintadlock.com/archives/2009/09/18/custom-capabilities-in-plugins-and-themes)
 * [https://wordpress.org/plugins/excel-export-plus/](https://wordpress.org/plugins/excel-export-plus/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Michael Cannon](https://wordpress.org/support/users/comprock/)
 * (@comprock)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/configurable-capability/#post-4632829)
 * Which user capability would you like?
 *  Thread Starter [Pionect](https://wordpress.org/support/users/pionect/)
 * (@pionect)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/configurable-capability/#post-4632830)
 * I made a change in _class.phimind.php_ on line 78.
    To change the capability ‘
   edit_plugins’ to ‘eeplus’
 * And in my plugin i’ve added:
 *     ```
       register_activation_hook( __FILE__, array("pnct_excelExport", "add_permissions") );
   
       class pnct_excelExport{
   
           function add_permissions(){
               global $wp_roles;
               $wp_roles->add_cap("administrator", "eeplus");
               $wp_roles->add_cap("editor", "eeplus");
           }
   
       }
       new pnct_excelExport();
       ```
   
 * It would be easy if you changed line 78 like this:
 *     ```
       $capability = apply_filters('phimind_excel_export_capability', 'edit_plugins');
       add_submenu_page( ... , $capability,  ... );
       ```
   
 * Or you could set it fixed to something like ‘eeplus’, like I did.
    In that case
   it would be nice if you’d include the first piece of code with ‘add_permissions’.
   And then add a filter so others are able to change the affected roles.
 *  [Michael Cannon](https://wordpress.org/support/users/comprock/)
 * (@comprock)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/configurable-capability/#post-4632831)
 * Thank you, just added the filter. Try it out via [https://github.com/michael-cannon/excel-export-plus/tree/0.3.0RC1](https://github.com/michael-cannon/excel-export-plus/tree/0.3.0RC1).
 * Filter name is `eep_menu_page_capability`.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Configurable capability’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/excel-export-plus.svg)
 * [Phimind Excel Export Plus](https://wordpress.org/plugins/excel-export-plus/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/excel-export-plus/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/excel-export-plus/)
 * [Active Topics](https://wordpress.org/support/plugin/excel-export-plus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/excel-export-plus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/excel-export-plus/reviews/)

## Tags

 * [capabilities](https://wordpress.org/support/topic-tag/capabilities/)

 * 3 replies
 * 2 participants
 * Last reply from: [Michael Cannon](https://wordpress.org/support/users/comprock/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/configurable-capability/#post-4632831)
 * Status: not resolved