Support

Home Forums Event Espresso Premium EE 4.6.4 Capabilities user role

EE 4.6.4 Capabilities user role

Posted: February 10, 2015 at 6:19 pm

Viewing 5 reply threads


JackB

February 10, 2015 at 6:19 pm

Hi team

Great to see that user role capabilities have been introduced. However, there are so many to select from, the level of control is a bit to finite to understand easily. I’ve played around with them for a while, but can’t seem to find the capability setting I need. I am using user role editor – here are my settings: http://awesomescreenshot.com/06b4drqn02

The issue is, I simply want the event admin to be able to do everything except see the settings or the extras.

Thanks


Garth

  • Support Staff

February 10, 2015 at 6:35 pm

Which settings specifically? The EE General settings? What extras are you referring to exactly?


JackB

February 10, 2015 at 6:42 pm

Hi Garth

I just discovered this doc which is useful https://eventespresso.com/wiki/event-espresso-4-roles-permissions/

Basically, I want to restrict access to “general settings” and Maintenance (listed under Extras in WP menu)


JackB

February 10, 2015 at 6:48 pm

Update: OK I can see from the details in the document I linked to above, that to prohibit access to EE4 General Settings, I was able to disable access to the manage_options core WP capability.

That solves my issue, now all I need is a snippet of code to remove visibility of those defunct menu items from non-admins.

Cheers


JackB

February 10, 2015 at 6:49 pm

By the way – that is a wonderful document – very well done to add such details 🙂 Kudos!


JackB

February 10, 2015 at 7:14 pm

I tried these but not working – suggestions?

// remove espresso menu items

function wpse28782_remove_plugin_admin_menu() {
   if( !current_user_can( 'administrator' ) ):
       remove_menu_page( 'espresso_general_settings' );
       remove_menu_page( 'admin.php?page=espresso_messages' ); // alternate method but still doesn't work
  endif;
}
add_action( 'admin_menu', 'wpse28782_remove_plugin_admin_menu', 9999 );

Also tried:

function wpse28782_remove_menu_items() {
    if( !current_user_can( 'administrator' ) ):
        remove_menu_page( 'edit.php?post_type=espresso_general_settings' );
    endif;
}
add_action( 'admin_menu', 'wpse28782_remove_menu_items' );
Viewing 5 reply threads

The support post ‘EE 4.6.4 Capabilities user role’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso