HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How to allow view discussions(only some catagories) only for members?
tsbvanillauser
New
Best Answer
-
peregrine MVP
this would be the perfect plugin for a beginner to write and learn from. look at a few other plugins that deal with comments and discussions...
something along the lines of ....
for the events that display discussions and comments.
add some code to check for categorythen $Session = Gdn::Session(); if (!($Session->IsValid())) { $Sender->EventArguments['Object']->FormatBody = "";
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
8
Answers
via the checkboxes in roles and permissions AND/OR via Categories - custom category permissions.
http://vanillaforums.org/discussion/28420/faq-what-frequently-asked-questions
see the FAQ for dashboard permissions
http://vanillaforums.org/discussion/comment/219730/#Comment_219730
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Thanks @peregrine. It great.
But what I want is, I need to display the title. I need to lock only content for non logged users. Is it possible?
you could make a plugin or alter premhide plugin.
just change the format body to a null string. if session is invalid.
probably not too terribly difficult.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
this would be the perfect plugin for a beginner to write and learn from. look at a few other plugins that deal with comments and discussions...
something along the lines of ....
for the events that display discussions and comments.
add some code to check for category
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
If you go this route or use the premhide plugin.
Be aware that the rss feeds are not blocked. So you may think you are blocking content for certain roles with either the above code or using the premhide plugin, the rssfeed will have the info in the clear.
you would need to override or check role in this view as well to stop the rss feeds for the discussions
https://github.com/vanilla/vanilla/blob/master/applications/vanilla/views/discussions/index_rss.php
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.