Restrict access to edit page for specific user
Looks like you're looking for Edit own user account permission.

This module add 'edit own user account' permission.
The goal of this module to prevent changes in user account information in the demo sites.

Or to do it in code:
function mymodule_menu_alter(&amp;$items) {
  if (isset($items['user/%user/edit'])) {
    $items['user/%user/edit']['access callback'] = 'mymodule_user_edit_access';
  }
}

function mymodule_user_edit_access($user) {
  if ($user-&gt;uid == 267 || $user-&gt;uid == 268) {
    return FALSE;
  }
  else {
     return TRUE;
  }
}