Any way to programmatically add to groups?

AI-generated summary

The discussion revolves around programmatically adding users to groups based on their account age. downey wants to create groups that are automatically populated with accounts older than N days, but can’t grant access to categories based on badges. Falco mentions that this feature isn’t on the core roadmap, but shares related discussions.

codinghorror suggests using trust levels, but downey points out that trust levels are limited to pre-defined groups and won’t work for his specific use case of creating cohorts based on join date. codinghorror proposes creating a small app that uses the Discourse API to move users into groups based on account age. downey considers this as Plan B, possibly using LDAP groups. Falco agrees that using the API is a better approach, sharing his own use case of creating groups based on employee data.

I’d like to have several groups that are automatically populated with accounts older than N days. The idea being that as user accounts age, new categories would open up to them based on the age of their account.

I can figure out how to do this with badges, but I can’t grant access to categories based on badges.

Is there any way to do what I described above?

There is some discussion about it, but the feature ins’t on core roadmap.

Hmm, why not just use the existing trust levels to do this?

Otherwise you’d have categories open up to people who created an account 45 days ago but did nothing.

Trust levels is close, but it’s limited to the pre-defined few groups. In my specific use case, I’d need more … basically the idea is creating cohorts based on join date.

I suggest a small app that moves users into groups using the Discourse API based on account age. Then the categories can key on the groups as they do.

Yes, that’s Plan B, but possibly with LDAP groups…

I my use case I would create groups based on employee data, like branch id and position.

Better handle this through API then.