Answers.Body: <p><a href="https://craftcms.stackexchange.com/a/5202/45">Brandon's answer</a> is correct, as far as how Craft natively handles auto-assignment of user groups.</p>
  
  <p>However, if you'd like to automatically assign user groups to new users <strong>when you are creating them while logged into the Control Panel</strong>, you can use this plugin built specifically for this purpose:</p>
  
  <ul>
  <li><a href="https://github.com/lindseydiloreto/craft-autoassignusergroup" rel="nofollow noreferrer">Auto-Assign User Group</a></li>
  </ul>
  
  <p>This will allow you to pre-select user groups, and those groups will be automatically assigned when you create a new user.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-11T02:51:30.223Z
Answers.Text: Hey thanks for your answer. I have updated my question.
Answers.UserDisplayName: Moin Qidwai
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-11T03:19:13.450Z
Answers.Text: That issue is because of the order in which the POST data is set... I've seen a few people get caught up by that (myself included). Solving that problem is the sole purpose of the Auto-Assign User Group plugin... feel free to download it and [check out the workaround](https://github.com/lindseydiloreto/craft-autoassignusergroup/blob/master/autoassignusergroup/AutoAssignUserGroupPlugin.php#L15)! The plugin will actually insert that data into the POST late in the process, making sure it gets saved properly.
Answers.UserDisplayName: Lindsey D
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-10T19:08:40.660Z
Answers.LastActivityDate: 2014-12-10T19:08:40.660Z
Answers.LastEditDate: 2017-04-13T12:51:00.200Z
Answers.UserDisplayName: Lindsey D
Answers.Body: <p>The setting still works, but keep in mind that for it to take effect, A) you have to be registering a user through a custom registration form on the front end, and B) you have to be logged out. Without those conditions, it’s not technically <strong><em>public</em></strong> registration.</p>
  
  <p>Default user group assignment has always taken place after the user was saved, and after the <a href="http://buildwithcraft.com/docs/plugins/events-reference#users-onSaveUser" rel="noreferrer">users.onSaveUser</a> event was called. See <a href="https://github.com/pixelandtonic/Craft-Release/blob/6d4295d3687e8ddcb3ef96772c032c72d88ac716/app/controllers/UsersController.php#L882-L894" rel="noreferrer">these highlighted lines</a> from UsersController::actionSaveUser() – the onSaveUser event gets called by <code>craft()-&gt;request-&gt;saveUser()</code>, and default group assignment happens in <code>$this-&gt;_assignDefaultGroupToUser()</code>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-11T02:52:03.433Z
Answers.Text: Hi Brandon, thanks for your answer. Could you look at the question again as I have updated it.
Answers.UserDisplayName: Moin Qidwai
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-11T14:42:41.987Z
Answers.Text: @MoinQidwai Updated my answer.
Answers.UserDisplayName: Brandon Kelly
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-12T03:29:46.060Z
Answers.Text: Oh ok are there any plans on creating a onAfterSaveUser event later on in craft? Thanks for your time and the awesome update to craft.
Answers.UserDisplayName: Moin Qidwai
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-12T15:10:29.847Z
Answers.Text: @MoinQidwai I just added a new onAssignDefaultGroupToUser event for the next release :)
Answers.UserDisplayName: Brandon Kelly
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-13T05:49:17.403Z
Answers.Text: Seriously Awesome. Thanks for your hard work.
Answers.UserDisplayName: Moin Qidwai
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-10T18:51:03.410Z
Answers.LastActivityDate: 2014-12-11T14:42:33.383Z
Answers.LastEditDate: 2014-12-11T14:42:33.383Z
Answers.UserDisplayName: Brandon Kelly
Body: <p>Hello I do not know if this is a bug or something but we just updated to craft 2.3 and got an issue which we did not have previously. 
  In user settings we can set the default permissions group but when we do create a new user this group is not applied to that user.Im not sure why this is, maybe something more needs to be done beginning Craft 2.3 but the simple flow of creating a new user worked previously. Upon the user account creation the default group would be set automatically.</p>
  
  <p>EDIT:</p>
  
  <p>Thank you for your answers. I was mistaken it is assigning the group but I cant get that group on an event trigger.</p>
  
  <pre><code>    craft()-&gt;on('users.saveUser', function(Event $event) {
          $user = $event-&gt;params['user'];
          var_dump($user-&gt;getGroups()); exit();
      });
  </code></pre>
  
  <p>I am doing the above in my plugins main PHP file and for some reason before updating it would give me the users group as the default one already assigned. After the update I get a empty array even though going to the control panel after registering I can see that the new user has the group assigned.</p>
  
Tags: <users><user-groups>
Title: Craft 2.3 new User does not set the default permissions group
ThreadText: # Craft 2.3 new User does not set the default permissions group
  
  (Asked by: username_0 on 2014-12-10)
  
  Hello I do not know if this is a bug or something but we just updated to craft 2.3 and got an issue which we did not have previously.
  In user settings we can set the default permissions group but when we do create a new user this group is not applied to that user.Im not sure why this is, maybe something more needs to be done beginning Craft 2.3 but the simple flow of creating a new user worked previously. Upon the user account creation the default group would be set automatically.
  
  EDIT:
  
  Thank you for your answers. I was mistaken it is assigning the group but I cant get that group on an event trigger.
  
  ```
      craft()->on('users.saveUser', function(Event $event) {
          $user = $event->params['user'];
          var_dump($user->getGroups()); exit();
      });
  
  ```
  
  I am doing the above in my plugins main PHP file and for some reason before updating it would give me the users group as the default one already assigned. After the update I get a empty array even though going to the control panel after registering I can see that the new user has the group assigned.
  
  **Tags:** users, user-groups
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2014-12-10. Score: 6 | Accepted answer
  
  The setting still works, but keep in mind that for it to take effect, A) you have to be registering a user through a custom registration form on the front end, and B) you have to be logged out. Without those conditions, it’s not technically ***public*** registration.
  
  Default user group assignment has always taken place after the user was saved, and after the [users.onSaveUser](http://buildwithcraft.com/docs/plugins/events-reference#users-onSaveUser) event was called. See [these highlighted lines](https://github.com/pixelandtonic/Craft-Release/blob/6d4295d3687e8ddcb3ef96772c032c72d88ac716/app/controllers/UsersController.php#L882-L894) from UsersController::actionSaveUser() – the onSaveUser event gets called by `craft()->request->saveUser()`, and default group assignment happens in `$this->_assignDefaultGroupToUser()`.
  
  > **Comments:**
  > **username_0**: Hi username_2, thanks for your answer. Could you look at the question again as I have updated it.  
  > **username_2**: @username_0 Updated my answer.  
  > **username_0**: Oh ok are there any plans on creating a onAfterSaveUser event later on in craft? Thanks for your time and the awesome update to craft.  
  > **username_2**: @username_0 I just added a new onAssignDefaultGroupToUser event for the next release :)  
  > **username_0**: Seriously Awesome. Thanks for your hard work.  
  
  ---
  
  ### Answer by username_1 on 2014-12-10. Score: 2
  
  [username_2's answer](https://craftcms.stackexchange.com/a/5202/45) is correct, as far as how Craft natively handles auto-assignment of user groups.
  
  However, if you'd like to automatically assign user groups to new users **when you are creating them while logged into the Control Panel**, you can use this plugin built specifically for this purpose:
  
  * [Auto-Assign User Group](https://github.com/lindseydiloreto/craft-autoassignusergroup)
  
  This will allow you to pre-select user groups, and those groups will be automatically assigned when you create a new user.
  
  > **Comments:**
  > **username_0**: Hey thanks for your answer. I have updated my question.  
  > **username_1**: That issue is because of the order in which the POST data is set... I've seen a few people get caught up by that (myself included). Solving that problem is the sole purpose of the Auto-Assign User Group plugin... feel free to download it and [check out the workaround](https://github.com/lindseydiloreto/craft-autoassignusergroup/blob/master/autoassignusergroup/AutoAssignUserGroupPlugin.php#L15)! The plugin will actually insert that data into the POST late in the process, making sure it gets saved properly.  
  
  ---
  
  