What if badges could optionally synchronize group membership?

I was looking at this topic today:

Thinking through the problem one area Discourse is a bit weak is around defining “dynamic” groups of users.

Give me a group of users that signed up more than 1 month ago

Give me a group of users that posted at least 10 times

And so on.

Badges on the other hand have very rich support for this “dynamic” nature once the fancy SQL is enabled.

Having an “extra” tick box on badges to bridge a badge to a group would add a lot of power. We have no way of assigning permissions to badge holders as it stands cause there is no backing group. Only the trust level badges have this special behavior (which we could port to this new system)

So my proposal here is for:

[ ]  mirror badge members in a group

Once this is ticked on a specific badge a “group” would be either automatically created or looked up based on name and the members of the group would be kept in sync as the badge membership changes.

Thoughts?

20개의 좋아요

Because the group membership management UI is so rich these days, changes should at least attempt to flow in the opposite direction as well (e.g. approving a Request to Join turns into a badge grant from the group manager; which wouldn’t normally happen as they aren’t staff).

6개의 좋아요

I feel like this has massive overlap with trust levels; it’s building a parallel system for.. well, I’m not sure why. In the quote you posted, that is literally the reason we have trust levels in the first place. So tying content unlock to

  • trust level 1 (a tiny bit of reading)
  • trust level 2 (a fair bit more reading)

should cover this scenario.

There are many many things I’d rather we work on than this.

I definitely do not see this as an urgent change, we lock out badge sql anyway out-of-the-box. However I do see this as something I would like to get to eventually.

It is a simple generalization of the “automatic group” system that now exists.

This does simplify workflows as well, you can grant a badge to a user and then you do not need to go to the group and also grant membership. For example: “Customer champion” badge that grants access to “champions” group and “champion discussion” category on the site. Having the bridge also means you only need to remove membership in 1 spot to have both badge and group change.

Nothing urgent to change here, its just that there are tons of parallels between groups and badges so having a bridge helps get automatic feature parity on both sides.

9개의 좋아요

Prior requests:

I know that just tying this up to the a badge re-uses a bunch of code, and simplifies a lot, but ideally this would be an option in the Groups UI, to have an option query that returns the user_id of members.

When you tie this to SSO and custom user fields, you get a very powerful system, where you can manage groups using queries on those custom fields + all the info Discourse already have.

10개의 좋아요

I have a client who wants just this. He wants to encourage people to fill in custom user fields after sign up and give them flair if they do it.

It’s easy enough to enable badge sql to find them a badge but we need to assign them to a group for flair.

How hard is a plugin to assign a user to a group of they have earned a badge?

5개의 좋아요

@pfaffman, 이 문제를 해결하셨나요? 저도 비슷한 상황을 알아보고 있습니다.

1개의 좋아요

저는 그렇게 하지 않았지만, 이제 그런 플러그인을 개발하는 방법을 알게 된 것 같습니다. 예산을 알려주시면 제가 도와드릴 수 있는 방법을 찾아보겠습니다.

1개의 좋아요

이 프로젝트에는 예산이 없습니다. Integromat이나 Zapier 스크립트로도 (조금 덜 우아하게) 구현할 수 있을 것 같아요.

음, 내가 너한테 충분한 커피 코드를 줄 수 있으면 네가 직접 수정해 볼 수도 있겠다. 지금은 좀 바빠서, 내가 할 수 있는 걸 알아볼게.

수정: 음, 내가 생각했던 대로 작동하지 않네. 어떻게 해야 할지 알아내는 데 시간이 좀 걸릴 것 같아.

2개의 좋아요

이 주제에 대해 매우 관심이 있습니다. 혹시 이와 관련된 플러그인을 개발하신 분이 계신지 여쭤보고 싶습니다. 없다면 제가 직접 개발하겠습니다.

가장 쉬운 방법은 Discourse 자동화를 활용하는 것입니다. '배지를 그룹과 동기화’하는 사용자 정의 스크립트를 작성하면 되는데, 구현이 비교적 간단합니다.

또는 Discourse Data Explorer의 보고서를 사용해 사용자를 그룹에 추가할 수 있나요?
이렇게 할 수 있다면 정말 멋질 것 같습니다.

이제 Automation 플러그인을 사용하면 이것이 가능합니다: :tada:

2개의 좋아요