WordPress Membership Integration (Private Forum) with Discourse

I’m looking to do the same. Would you be willing to share your final code for:

/* Some condition that returns true if the user doesn't meet the membership requirement */