How to add users under a specific role
I assume you use something like Entity reference to add children to parents and to teachers.

I don't think that default Drupal supports this kind of user permissions. As I couldn't find any modules for this functionality, you probably need to do some coding.

The easiest approach would be altering the user/%uid/edit menu item with a custom access callback in a custom module. This ensures users can only access the user edit pages matching your criteria:

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($account) {
  global $user;

  // May edit own profile
  if ($account-&gt;uid == $user-&gt;uid) {
    return TRUE;
  }

  // Check if $user has permissions to edit $account
}


The access callback should check if the $user has role Teacher or Parent and if it is referencing to the $account->uid.

Edit:

I just realize you also need to manage profile view rights, this could be done with the same hook, on path user/%user.