Categories access based on custom fields


(Nicolas Goutaland) #1

Hi,
Thanks for your amazing work. Discourse is a very great forum.

Long story :
We have a mobile application were users are required to login. Onced logged, they may access to a forum, and are automatically logged in throught SSO. If user do not exists on discourse, it will be created, else, its profile will be updated with current user data. We have several special fields that describe our users, such as company, department, etc…
We are transfering them to discourse.

That was the easy part, now, we want to grant access to forum categories based on these metadata. If there a way to achieve that ? We may create groups for each metadata value, but it will be a mess to configure. So, is there something like that in discourse ? Should we develop a plugin allowing us to determine categories access based on users custom fields ?

TLDR : I want to know if there is a built-in way to grant categories access based on user custom fields.

Thanks for your help.

Regards


(Rafael dos Santos Silva) #2

No, but you can:

  • Create a simple script that reads from your database and setup all the groups on Discourse using the API

  • Pass group membership along on the SSO payload.

SSO is easier, the only problem is that membership is only updated on login.


(Nicolas Goutaland) #3

Can you tell me more about group membership on SSO ?
This means that I have to create group first, then affect groups to categories and finally, through SSO Payload, add groups information (add_groups / remove_groups?


(Rafael dos Santos Silva) #4

Exactly!

Groups SSO info are here:


(Nicolas Goutaland) #5

Thanks a lot for your help.