New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle groups #7
Conversation
As you noted this is going to require some tests. I recommend you look at the existing tests and how they work, but you can also reference the rspec documentation. |
If possible I'd like us to keep any modification of group membership out of this group plugin, and instead move it into this method of discourse core That way, we have a clean API which all plugins can use. The most difficult thing here is the data model. How do you decide which groups to add and remove the user from? And how does that affect manually adding/removing users from groups in Discourse itself? e.g.
Inspecting this as a human, we can see that the final state should be
Now what should happen? An admin has explicitely removed the user from If we can iron out the data model, then I think this would be a great addition to Discourse core. If you like, a topic on Discourse Meta would be welcome. Happy to help with implementation there once we plan things out. |
It seems that the basic work was made upstream thanks to @angusmcleod I guess then that this PR has to be updated according. Thanks for your work @mattcg :) |
As discussed in a comment on the plugin post and in a separate post asking for proposals. Would appreciate some help with tests as I am not an experienced Ruby developer.
Introduces three new settings:
openid_connect_handle_groups
will activate the code path for handling groups in the tokenopenid_connect_create_groups
will create groups that the IdP user is a member of but that are not present in Discourseopenid_connect_strict_groups
will remove user from Discourse groups that are not present in the tokenThanks to @rysiekpl who originally wrote most of this code for a prototype plugin.