private function addParentRoles(NsmRole $role)
 {
     if ($role->hasParent()) {
         $p = $role->getParent();
         $this->role_names[$p->role_id] = $p->role_name;
         $this->addParentRoles($p);
     }
 }
 public function rechainChildren(NsmRole &$role)
 {
     $parent = $role->hasParent() ? $role->getParent() : null;
     $children = $role->getChildren();
     foreach ($children as $child) {
         $child->set("role_parent", $parent);
         $child->save();
     }
 }