I've created two administrator users X and Y. And now I need to remove capability of 'edit_plugins' from user Y.
I've searched and found, http://goo.gl/LttuvX
$user = new WP_User( 'Y' ); $user->remove_cap('edit_plugins');
But it is not working please let me know how to do it.
Previously I've created new role with same capability as administrator, but in plugins we create menus like
add_menu_page(..,capability => 'administrator',..); so new role fails to access plugin pages.