How to Restrict Forum Content By Role
How to achieve this in Vanilla Forums?
Making restricted content areas in your Vanilla Forums community requires a few simple steps:
Creating categories and adding custom permissions
First, you need to create categories to load your restricted content. See this post on how to create categories. Be sure to select the “This Category has custom permissions” checkbox.
This will allow you to select how each role accesses the content. The “Add” permission allows someone to add a comment or discussion, whereas the “View” permission allows them to see the content. Simply uncheck the box to remove this permission. In the below example only Staff and Administrators roles can add or view content:
Don’t forget to click save!
Create extra roles, if needed
Your restricted content may require a new role, separate from the default Vanilla roles. For example, if you’re creating a support community and you want a section for Pre-Sales discussions, you can create a new role called Prospects. You can do this by heading over to the Roles & Permissions. This can be found under “Users” in your Vanilla dashboard.
Select Add Role and you will be given a table to select what permissions you wish to assign to that role.
You should modify how they will interact with Default Category Permissions. The default permissions control how a user interacts with every category that does not have custom permissions. As the following shows, they have now have no access to any content in the community, except the Pre-Sales category.
If you haven’t already created a Pre-Sales category (before you created the role), you won’t see that option. Create the a Pre-Sales category first and select custom permissions. Once you save the new category, you can go back to manage the roles permission and modify their access.
Manually changing people’s access
You can change any user’s access by changing their role. This can be done in the user table from the dashboard or from a member’s profile.
Just select or unselect the role your want a member to have:
Automated by passing role info using jsConnect/SSO
If you are looking to automate the experience (perhaps via paid memberships, or ties to your own existing membership list), we have you covered with our jsConnect library via SSO. You can learn the technical aspects of this here, but the basic premise is that you will be able to pass role info into your Vanilla powered community from your existing site using SSO.
If you’re using WordPress, our free plugin is easy to set up and does all the work for you. If you’re using WordPress and want to charge for access to content, you can use our Wishlist integration to pass user roles right into Vanilla.