mozilla/kitsune — pull request #1172 by willkg (2013-02-27 15:13:39+00:00)
Title: [bug 845582] Implement ReadOnlyBackend

Instead of wiping out all AUTHENTICATION_BACKENDS which kicks up tons
of errors, this changes read_only_mode to use the brand new
ReadOnlyBackend which categorically rejects everything.

How to test:

1. run kitsune locally and log in with a non-superuser account
2. shut down kitsune locally, then put it in read only mode by adding `read_only_mode(globals())` to the bottom of your `settings_local.py` file
3. run kitsune locally again (now in readonly mode) and try to use the site--ERRORZ!
4. apply this patch
5. run kitsune locally again (now in readonly mode with the patch) and try to use the site--AWESOME!

One note is that I had to nix the lines in the `read_only_mode` function regarding slave databases since I didn't have that set up on my machine and didn't feel like figuring it out right now.

One problem with this is if permissions get cached on user objects. So if we go into readonly mode and then come out, will those user objects in cache all have no permissions?

r?