original_string: public function formExtendFields($form)
      {
          if ($form->getContext() == 'myaccount') {
              return;
          }
  
          if (!$this->user->isSuperUser()) {
              $form->removeField('is_superuser');
          }
  
          /*
           * Add permissions tab
           */
          $form->addTabFields($this->generatePermissionsField());
  
          /*
           * Mark default groups
           */
          if (!$form->model->exists) {
              $defaultGroupIds = UserGroup::where('is_new_user_default', true)->lists('id');
  
              $groupField = $form->getField('groups');
              $groupField->value = $defaultGroupIds;
          }
      }
code: public function formExtendFields($form)
      {
          if ($form->getContext() == 'myaccount') {
              return;
          }
  
          if (!$this->user->isSuperUser()) {
              $form->removeField('is_superuser');
          }
  
          /*
           * Add permissions tab
           */
          $form->addTabFields($this->generatePermissionsField());
  
          /*
           * Mark default groups
           */
          if (!$form->model->exists) {
              $defaultGroupIds = UserGroup::where('is_new_user_default', true)->lists('id');
  
              $groupField = $form->getField('groups');
              $groupField->value = $defaultGroupIds;
          }
      }
code_tokens: public function formExtendFields ( $ form ) { if ( $ form -> getContext ( ) == 'myaccount' ) { return ; } if ( ! $ this -> user -> isSuperUser ( ) ) { $ form -> removeField ( 'is_superuser' ) ; } /*
           * Add permissions tab
           */ $ form -> addTabFields ( $ this -> generatePermissionsField ( ) ) ; /*
           * Mark default groups
           */ if ( ! $ form -> model -> exists ) { $ defaultGroupIds = UserGroup :: where ( 'is_new_user_default' , true ) -> lists ( 'id' ) ; $ groupField = $ form -> getField ( 'groups' ) ; $ groupField -> value = $ defaultGroupIds ; } }
docstring: Add available permission fields to the User form.
  Mark default groups as checked for new Users.
docstring_tokens: Add available permission fields to the User form . Mark default groups as checked for new Users .