# Add option to set primary group if no current primary group

**URL:** https://meta.discourse.org/t/add-option-to-set-primary-group-if-no-current-primary-group/72050
**Category:** Feature
**Created:** [Octobre 14, 2017, 2:20 UTC](https://meta.discourse.org/t/add-option-to-set-primary-group-if-no-current-primary-group/72050 "2017-10-14T02:20:04Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![jcoates](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jcoates/32/78029_2.png) [@jcoates](https://meta.discourse.org/u/jcoates)
#### Post date: [Octobre 14, 2017, 2:20 UTC](https://meta.discourse.org/t/add-option-to-set-primary-group-if-no-current-primary-group/72050/1 "2017-10-14T02:20:04Z")

</div>

It would be nice to have an extra check box in the group options to set a group as a users’ primary group if and only if they do not already have one.

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/d/ad6a7f7871c2ad865f0b2800394ab5a0a846f3c9.png)

Currently, users are primarily grouped in whatever group they join last with the automatic setting applied. While this is great for groups like staff or site leaders, there are are lesser groups that it would be handy to set as a user’s primary group if and only if they don’t already have one set. This would also make it much easier to distribute flair without potential unintended consequences.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [Octobre 14, 2017, 9:48 UTC](https://meta.discourse.org/t/add-option-to-set-primary-group-if-no-current-primary-group/72050/2 "2017-10-14T21:48:44Z")

</div>

Are you absolutely sure about this? What is the repro?

---

<div class="post-metadata">

### Author: ![jcoates](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jcoates/32/78029_2.png) [@jcoates](https://meta.discourse.org/u/jcoates)
#### Post date: [Octobre 15, 2017, 6:50 UTC](https://meta.discourse.org/t/add-option-to-set-primary-group-if-no-current-primary-group/72050/3 "2017-10-15T06:50:32Z")

</div>

I am going off of @trash’s explanation… I’ve shied away from using this feature because of the potential problems it could cause.

> [@What exactly does "Automatically set as primary group" do?](https://meta.discourse.org/t/what-exactly-does-automatically-set-as-primary-group-do/62222/2):
>
> Yes If you have more than one primary groups (for example groups A and B) and a user of A enter in the group B, the last group (B) will be automatically set as primary. Admins can change the primary group for each user I don’t know about titles but in my memory some configurations of the group remain even if a user leave the group (e.g. if you set the group to assign TL4, when a user leave the group he still remain to TL4).

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [Octobre 15, 2017, 11:03 UTC](https://meta.discourse.org/t/add-option-to-set-primary-group-if-no-current-primary-group/72050/4 "2017-10-15T11:03:26Z")

</div>

I can confirm that this function works as I wrote in the link added by @jcoates .

The problem here is that administrators tend to use the primary group function incorrectly because it is not possible to customize the secondary groups (except for titles and trust levels).

In theory each site should have only one primary group, not two or ten (as @codinghorror said in another topic some time ago).

But, because people want to display a flair for each group or customize each group in other ways, they modify them as primary (that is basically a wrong way).

And when the same person belongs to several primary groups, the problem begins because an administrator must decide which primary group should be shown manually changing it.  
When you have to decide which group to show for a few users it takes a few minutes, but if users are tens and dozens …

> [@jcoates](#):
>
> It would be nice to have an extra check box in the group options to set a group as a users’ primary group if and only if they do not already have one.

What happen if you have 99 users who are not in a primary group and 1 user who already belongs to another primary group?

I would be in favor of a user profile setting so that each user can decide which primary group to show themselves (if they belong to more than one primary group).

---

<div class="post-metadata">

### Author: ![jcoates](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jcoates/32/78029_2.png) [@jcoates](https://meta.discourse.org/u/jcoates)
#### Post date: [Octobre 15, 2017, 12:47 UTC](https://meta.discourse.org/t/add-option-to-set-primary-group-if-no-current-primary-group/72050/5 "2017-10-15T12:47:04Z")

</div>

> [@Trash](#):
>
> What happen if you have 99 users who are not in a primary group and 1 user who already belongs to another primary group?

All 100 would still be in the group in question, but 99 would have that group as their primary group, one would still have their old primary group as their primary group. 🤔

I’m not saying they should alter the current check box’s functionality. Instead, they should add a second option to set it the group as a primary group only if the user does not currently have one.

This will in effect create a helpful hierarchy of groups (1) Top level that always become primary when joined, (2) ones that will become primary if the user has no other primary group, and (3) low level groups that never become primary groups automatically.

Best practice imo would be to have a small number of important (1) top level groups, set virtually any group with flair as a (2) semiautomatic group, and use (3) non-automatic groups mostly for admin selecting/permission groups.

> [@Trash](#):
>
> I would be in favor of a user profile setting so that each user can decide which primary group to show themselves (if they belong to more than one primary group).

Nothing is special about a primary group other than it being set as that user’s primary group. As far as I am aware, any group to which a user belongs can be set as a primary group.

Having a place on the profile to select your primary group would be really nice. We would probably want to have an option on the admin side “allow users to select this group as their primary group.”

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [Octobre 15, 2017, 2:38 UTC](https://meta.discourse.org/t/add-option-to-set-primary-group-if-no-current-primary-group/72050/6 "2017-10-15T14:38:46Z")

</div>

I suppose that building a hierarchy for groups requires a lot of work and I do not know if the team would support such a change even if it was made by an external developer.

But… who knows? 😀

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [Octobre 15, 2017, 4:32 UTC](https://meta.discourse.org/t/add-option-to-set-primary-group-if-no-current-primary-group/72050/7 "2017-10-15T16:32:10Z")

</div>

> [@jcoates](#):
>
> easier to distribute flair

Despite the attribute value bloat 😒 wouldn’t having group names made available for CSS be enough?

I can’t really see the benefit outweighing the cost of implementing hierarchy, settings, and the code that would be involved for doing anything more complicated than that for the purpose of adding flair.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [Octobre 15, 2017, 8:54 UTC](https://meta.discourse.org/t/add-option-to-set-primary-group-if-no-current-primary-group/72050/8 "2017-10-15T20:54:12Z")

</div>

The only simple change I support here is stopping the override, once a primary group is set, stop messing with it

---

<div class="post-metadata">

### Author: ![jcoates](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jcoates/32/78029_2.png) [@jcoates](https://meta.discourse.org/u/jcoates)
#### Post date: [Octobre 16, 2017, 1:23 UTC](https://meta.discourse.org/t/add-option-to-set-primary-group-if-no-current-primary-group/72050/9 "2017-10-16T01:23:09Z")

</div>

> [@sam](#):
>
> The only simple change I support here is stopping the override,

That’s all I was really asking for… Just another check box that lets you set as primary group without overriding any current primary groups.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [Octobre 16, 2017, 1:23 UTC](https://meta.discourse.org/t/add-option-to-set-primary-group-if-no-current-primary-group/72050/10 "2017-10-16T01:23:58Z")

</div>

I don’t want to add a checkbox, there is no point in yet another option.

Just amend the default behavior to stop with all the overriding.

---

<div class="post-metadata">

### Author: ![jcoates](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jcoates/32/78029_2.png) [@jcoates](https://meta.discourse.org/u/jcoates)
#### Post date: [Octobre 16, 2017, 1:25 UTC](https://meta.discourse.org/t/add-option-to-set-primary-group-if-no-current-primary-group/72050/11 "2017-10-16T01:25:46Z")

</div>

Sounds like a good call… fewer ways to blow your leg off.
