Partial read-only mode

Every now and then we come across a situation where a forum needs to be in “read only” mode in order to prevent new posts being made.

However, it is really annoying that read only mode also prevents configuration changes, SSO synchronization and logging in.

It would be great if we had some kind of partial read only mode where only posts and post actions would be read-only.

Right now the only thing I can think of is stripping post permissions from all category security groups but that is a bit too hacky and it requires storing them somewhere else for the time being.

Does anyone have an idea on what the best way to accomplish this would be?
Probably this is plugin territory, but still: what approach would be best?

11 Likes

A plugin + site setting should do the trick.

Maybe try the validate_post hook, add a custom validation that returns “no good” if the site setting sets it to readonly.

5 Likes

I used NewPostManager.add_handler, it seems like the :validate_post event only notifies and does not present the opportunity to return a result and deny the post.

Here’s a plugin which disables posting with the flick of a button: GitHub - communiteq/discourse-prevent-posting

Configuration

Go to Admin - Plugins - discourse-prevent-posting - Settings

prevent posting enabled : enable the plugin and prevent new posts from being made.

prevent posting message : message to show as global notice when the plugin is enabled.

prevent posting allow pms : if enabled, PM’s are allowed.

5 Likes

I think we should add this to our roadmap @sam

5 Likes

Sure!

Though I would like to nail down the setting here, ideally we can fit it all into a single site setting with multiple options.

Would like to first get a good spec going. Some questions:

  • What about reactions and plugins?
  • What about user profiles?
  • What about signing up with new accounts?

I worry also about allowing too much fidelity here.

Maybe a simple maintenance mode on/off and allowing admins always to bypass, is good enough?

4 Likes

FYI/FWIW -

For our community, this plugin provides a “Sabbath” mode. The heart behind it is to prompt community members to take what they’ve experienced in our online context and lovingly serve their neighbors in their local communities.

The key components behind what Richard developed are:

  • The ability to schedule both routine and occasional times when posting is disabled and turned back on. There’s the ability to disable posting for weekends (ongoing) and also for major holidays (occasional).

  • The capacity to sync this with a custom Global Banner so we don’t confuse participants (“why is the site not working?!”). Rather, we can clearly explain to visitors and members why posting is temporarily disabled.

As for other activity:

  • Disabling reactions is congruent with the original vision but I suppose could be a checkbox admins could toggle in order to expand the versatility of this site setting

  • I don’t think this plugin affects any other plugins

  • New accounts can be created - only posting is disabled

It works beautifully. I’m excited that this capacity might be integrated into the roadmap.

1 Like

@outofthebox Actually the scheduling is not part of this plugin, that’s the scheduled-readonly plugin which works closely together with the prevent-posting plugin.

3 Likes

I stand corrected! :slight_smile:

2 Likes