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;
        }
    }
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;
        }
    }
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 ; } }
Add available permission fields to the User form.
Mark default groups as checked for new Users.
Add available permission fields to the User form . Mark default groups as checked for new Users .