Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Config Option for Private Forum #86

Closed
TheYorkshireDev opened this issue Jul 6, 2018 · 5 comments
Closed

Allow Config Option for Private Forum #86

TheYorkshireDev opened this issue Jul 6, 2018 · 5 comments

Comments

@TheYorkshireDev
Copy link

For the forum I manage at work we required all users to be logged in to view content. As it stands in PopForum this is not the case, you can browse even if the user is logged in. I suggest adding a feature (I suggest this having done it already and willing to put it in the forum myself), we have a config flag on the initial Forum/Startup page which activates a check onActionExecuting to disable non-authorized users.

Obviously the default would be open to all, however for developers looking for a forum they can lock down if required for their purposes the feature is there.

@ghost
Copy link

ghost commented Jul 9, 2018

This functionality will be great!

@mcshaz
Copy link

mcshaz commented Mar 9, 2020

(I suggest this having done it already and willing to put it in the forum myself)

You couldn't post the code which hides posts from non-Authorized users could you @TheYorkshireDev ? If needed I will implement this myself, but a bit of code already tested and in production is obviously going to be quicker and safer from a security/testing standpoint.

Thanks for considering.

@jeffputz
Copy link
Collaborator

jeffputz commented Mar 9, 2020

@mcshaz The easiest path is probably to look at the way the PopForumsUserAttribute works in the OnActionExecuting checking for the existence of HttpContext.Items["PopForumsUser"] as User, which is populated in the middleware. Make your own action filter and apply it globally, looking for that user object. Exempt things like login, create, forgot password, etc., but redirect for everything else when there's no user there. (Or... just wait... it'll probably be in the next release.)

@mcshaz
Copy link

mcshaz commented Mar 10, 2020 via email

@jeffputz
Copy link
Collaborator

OK... I think this feature is pretty well baked. There's a new checkbox in the general settings in admin. It has also been deployed to the commercially hosted version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants