Restrict users that are logged in with custom role to ask a question or start discussion
We have a few custom roles. We have restricted them from creating topics and creating comments within our forum. But we also want to restrict them from asking questions or start discussions after they login.
These are registered user with an additional custom role. Is this possible?
Page 1 / 1
@Hannah Bailey my understanding is that as you describe it, it is not possible because a user will always have the highest access level custom roles provide. So assigning a limiting role would have no effect.
Your solutions are:
Remove the custom roles that are granting the access to starting topics for the group of people you do not want to be able to post
Use a custom role based rule to hide the links to start new topics for the people with that custom role via third party script
Hope this makes sense!
@SmartlyGreg
We have removed the capability for the register user AND the custom role “requestor” to create any topics or discussions. (Please see screenshot below)
But they are still able to click on the +Ask Question/ Create Discussion button at the top right. And able to create a title and description. But the category drop down menu is blank. Because we remove their capability to create a topic for all categories regarding questions and discussions.
This will be come every frustrating to our user if they potential fill-out the Create Topic form and then unable to actually submit the form.
We would like to have an error message show after they click the +Ask Question/Create Discussion button if they are unable to create a topic of any categories.
Thanks for sharing your feedback, it is important for us to know that you are running into a limitation here. Even though I work with the platform for more than five years, I have never known that the button would still show even if a user has no permissions to start a new topic anywhere.
What you are doing is not usual for most communities, simply because Community Managers want to stimulate content creation, also by newly registered users. We even display this button (and give access to this page) when a visitor is not logged in or registered, for the very same reason: to stimulate activity.
User-generated content is the main driverfor success if you have a community, so it should only be limited if there are very good reasons for it. Do you have a very specific target group / use case, or want to prevent abuse? If you could explain what you are trying to achieve with limiting this, then we might be able to point you to other strategies which do not cause such a challenge with the UI?
If I had to do this, then I probably would either hide the button for users without permission, or add a messaging to this page that only displays when a user does not own these rights. Both can be achieved with a little bit of custom code, we can probably also assist you with this.
@Julian Thanks for your response.
We have default roles within our platform as well. We have built our community for our main roles “agents” and “admins” because they are in our platform everyday. Our other roles we want to limit their visibility and give some access to our knowledge base guides. But these other roles we do not want to ask or start any discussions because they do not use our platform on a day to day basis.
Would love to get some help with the custom code if that is possible.
@Hannah Bailey you can go either way of removing the button for the people that shouldn’t see it or display an error message for the start a topic page. I’d opt for the first option rather than an error message, but you can choose of course. Below is how to remove the create topic button from the mega menu (this might not work on other navigation bars, but can easily be re-purposed) , and it will only apply for the custom role called “ROLENAME”, or you can replace the role name in the code obviously! :)
<!-- Remove the Create Topic button for a given role --> <script> if (inSidedData.user.role == 'ROLENAME') { document.getElementsByClassName('menu-create-topic')a0].setAttribute('style','display:none;'); } </script>
Hope this helps!
thanks @Hannah Bailey for elaborating on your use case, I guess it makes sense if the regular registered user only visits to read content… Let me tag @xiaoyu-shen because she probably wants to know about your challenge with the UI as well.
Also thanks to you, Greg, that code looks like it will do the trick!
If you ever had a profile with us, there's no need to create another one. Don't worry if your email address has since changed, or you can't remember your login, just let us know at community@gainsight.com and we'll help you get started from where you left.
Else, please continue with the registration below.