Discourse as SSO host -> Restrict content in WP based on Discourse groups


#1

I have a premium group in my forum which I want to provide access to exclusive content in wordpress.
Is there any way to restrict certain wordpress pages or content based on Discourse user roles or groups?

Using wordpress as SSO host is not an option unfortunately


#3

Is there any way to set up a custom shortcode which makes an API call to check the user’s group status?


(Bhanu Sharma) #4

In it’s current form, No but maybe it would come in near future … @Simon_Cossar any Plans on such implementation?


(Simon Cossar) #5

Are you using the WP Discourse plugin? If so, some functions have been added to the latest version (1.5.0) that could help you. It will be in the WordPress plugin repository later today.

The functions were added with the opposite use case in mind - restricting content on Discourse based on membership in a WordPress group, but they could be used to do what you want. I’ll write some documentation about how to use the functions later this week.


#6

Perfect timing! Will test it then …


(Simon Cossar) #7

I need to make a small change to the get_discourse_user function that has been added. It’s currently not returning the groups data. I can add a parameter to it so that it returns all the data that is available for the user. That will be in the next update - sometime later this week.