Default Custom Group


(Jay) #1


Is there any way to set a custom group as the default, so that when a user joins they are automatically placed in the group?

I’ve looked through the settings but found nothing relating to this. It would help in terms of external management.

  • Jay.

EDIT: Or is it even possible to have a wildcard email domain like so that all emails are added.

(Michael Downey) #2

Groups have a setting for email domains, so users with those domains will be added.

But otherwise I don’t think a default group is possible at this time.

(Mittineague) #3

In a way, the Trust Level 0 = New user - is like a group as they are in a “sandbox”

So if you were thinking of a group for “restrictions” rather that “privileges” that might work for you.

(Rafael dos Santos Silva) #4

Two points:

  • If everyone new will be on the group, ain’t easier to put everyone who aren’t new in another group? Maybe you can use the reverse

  • One thing that would be very useful would be the same customization we have for badges (free SQLs) for group, where we can use the exact same triggers. Using PostgreSQL FDW (there are plenty!) groups would be so powerful. You could update a group with other SGBD, Tweet or even Google Docs Spreadsheet!!!

(Mittineague) #5

Have you looked at all the Admin Settings recently?

What’s missing that can’t be tweaked?

(Rafael dos Santos Silva) #6

No, I was travelling to our capital to a hackaton, and can’t see my intranet instance :sadpanda:

We have SQL-based groups now? Fuck yeah! :thumbsup:

(Mittineague) #7

Yes indeed, Custom Groups are possible.
And if you’re good at queries they can get custom Badges.

(Felix Freiberger) #8

How exactly can I create such an SQL-based group? I browsed through the admin settings and did not find anything. The related feature request still says it isn’t on the roadmap.

(Jay) #9

Is there a “On email confirm/user activation” hook/event trigger, so that I could (learn to) create a plugin that just plays with some queries and places users in the group I wish them to have?

(Mittineague) #10

Does this help at all?

And this is good to read

(Felix Freiberger) #11

But this explains how you can use badge SQL to assign badges to members of a (manually managed) group.

Under SQL-based group, I understand a group whose membership is determined automatically (like Staff) by a custom SQL query.

(Rafael dos Santos Silva) #12

I don’t think you undestood this.

I want the exact same experience for custom SQL-badges but for groups.

Like, once a day run a SQL query and update all groups on my discourse.

This way, you can manage groups in awesome ways I described here:

(Mittineague) #13

I guess not, sorry.

So what you’re saying is the Admin UI for Groups is lacking?

Any way to programmatically add to groups?
(Felix Freiberger) #15

It is lacking the ability to define a new group which automatically sets its members to the result of a custom URL query (executed regularly).

(Rafael dos Santos Silva) #16

Yes, exactly!

We have a database with all employees and their title.

They want a category only for high executives, but they change all the time, and it’s impratical.

At the same time the badges custom SQL support is AMAZING!

Having the exact same thing, but for groups, we can add foreing tables to Discourse Database and manage groups automagically.

PostgreSQL foreign table support it’s very advanced and you can create foreign tables from: PostgreSQL, MySQL, Google Docs, MongoDB, Redis, Twitter, and LDAP!

I think this would be a good feature for many people, when you want a tight integration between Discourse and your already established community/organization/enterprise.

(Mittineague) #17

If you think of Trust Level 3 as a Group
Members can gain it and members can lose it.

What do you see as the criteria the code would use in determining membership eligibility?

(Rafael dos Santos Silva) #18
  job_title = 'Executive Director';