Cuztomisation of interface for staff users

Hello,

I’ve installed this Team control extension, and configured a new user with limited privileges. However, I’ve noticed some weird permissions even after restrictions and its too important to avoid.

  1. The ‘Go To WP Admin’ button still present at the bottom, and clicking on it giving normal users access to dashboard where they could manage everything same as Administrator user. This is not right! I tried to remove that icon from UI as per this forum thread but that is not working for me. Even if that icon removed, I think they could access the dashboard with direct URL https://DOMAIN/wp-admin/index.php, so is there any way to restrict them access WP dashboard (They would only require access to MainWP dashboard area, not normal WP dashboard)

  2. Is there any way to remove menus from left panel? If so, can you give me an example code for this?

  3. Is there any way to remove those small icons at the top-right corner next to Add New Button? If so, please share an example code

  4. Restrict access to normal WordPress dashboard, and always redirect to MainWP dashboard? Any sample code for these.

Please help me to achieve these tasks too.

Thanks,
Fasal

Hi Fasal,

Thanks for reaching out.

By design, the Team Control extension is created to control permissions just inside the MainWP Dashboard pages. All other permissions need to managed by using some 3rd part that is designed for this. You can get some Role Manager plugins that will allow you set additional permissions to a role created in the Team Control.

To remove menu items, you can use the mainwp_main_menu_disable_menu_items filter. Here is an example for removing the Status item:

add_filter( 'mainwp_main_menu_disable_menu_items', 'mycustom2_mainwp_main_menu_disable_menu_items' );
if ( !function_exists( 'mycustom2_mainwp_main_menu_disable_menu_items' ) ) {
  function mycustom2_mainwp_main_menu_disable_menu_items( $disable_menus ) {	 
	  if (isset( $disable_menus['level_2']['ServerInformation']) ){
		  $disable_menus['level_2']['ServerInformation'] = true;
	  }
	  return  $disable_menus;
  }
}

To remove header buttons or some other UI elements, you can can always use custom CSS.
I hope this helps, let me know how it goes.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.