Give Editor Access To Sidebar

I want to give the Editor Role access to editing the sidebar and it’s contents. I have a text widget in there and in order to edit this text widget the user needs to be an admin – this sucks. How do I grant permission to the Editor Role that will give him access to edit the sidebar?

Solutions Collecting From Web of "Give Editor Access To Sidebar"

The edit_theme_options capability should allow the user to edit the sidebar as described on this page :
http://codex.wordpress.org/Appearance_Widgets_SubPanel

Code to add to functions.php

   $role = get_role('editor'); 
   $role->add_cap('edit_theme_options');

Edit:

This should work to prevent editor accessing themes or menus

function custom_admin_menu() {

    $user = new WP_User(get_current_user_id());     
    if (!empty( $user->roles) && is_array($user->roles)) {
        foreach ($user->roles as $role)
            $role = $role;
    }

    if($role == "editor") { 
       remove_submenu_page( 'themes.php', 'themes.php' );
       remove_submenu_page( 'themes.php', 'nav-menus.php' ); 
    }       
}

add_action('admin_menu', 'custom_admin_menu');

I haven’t had chance to test this, but it only removes them from the menu they may still be able to access them by typing in the URL directly.

If you just want to configure this easy as possible, use the Members plugin. The capability you’ll need to add is ‘edit_theme_options’. Be aware that this will grant more than just the widgets area, this also grants the editor access to the entire Appearance menu. See here

http://wordpress.org/extend/plugins/members/

If you want to do this programmatically, you’ll need to use add_cap().

$editor = get_role('editor');
$editor->add_cap('edit_theme_options');

You can throw that code into its own plugin, and your done.
Or put it into functions.php.