Avoid access to profiles (user/%user/view)
There are four problems with the code you reported:


The code is changing the menu type, when it should not do so.
The code is changing values that it should not touch, if the purpose is to only change who can access the user profiles.
user_edit_access() and user_access() expect the argument they receive to be a user object, not a string. It is wrong to set "access arguments" to array('access administration pages'), as you are doing.
Even if you would set "access arguments" to array(1), user_edit_access() allows the users to see their own user profile; if you want to avoid to show to the users their own user profile, then that function is not the function I would use as access callback.
As said by jhedstrom, it is not necessary to use code in this case, when it is enough to don't give the permission to access user profiles to those roles you don't want to be able to see any user profile. The answer I am going to give takes the assumption you don't want the users to see any user profile, including their own; in this case, removing the permission to access user profiles doesn't help, as Drupal still allows the users to see their own user profile.




function mymenu_menu_alter(&amp;$items) {
  $items['user/%user/view']['access callback'] = FALSE;
}

function mymenu_user_view_access($account) {
  return $account &amp;&amp; $account-&gt;uid &amp;&amp; user_access('administer users');
}