M CHANGELOG +1 -1
@@ 1,7 1,7 @@
Changes
-------
-1.9.0 (unreleased)
+1.9.0 (2023-02-20)
- Prevent redirect loop when MAX_DURATION is used. Refs ~petersanchez/django-impersonate#67
- Allow OPTIONS requests when READ_ONLY is True. Refs ~petersanchez/django-impersonate#69
M README.rst +18 -0
@@ 82,8 82,10 @@ Use
===
#. Add ``impersonate`` to your INSTALLED_APPS
+
#. Add ``impersonate.middleware.ImpersonateMiddleware`` to your
``MIDDLEWARE`` setting.
+
#. Add ``impersonate.urls`` somewhere in your url structure. Example:
::
@@ 278,6 280,22 @@ impersonating users to read only imperso
Value should be a boolean, defaults to ``False``
+If the ``CUSTOM_READ_ONLY`` is set, then that custom function is used,
+and this setting is ignored.
+
+::
+
+ CUSTOM_READ_ONLY
+
+A string that represents a function (e.g.
+``module.submodule.mod.function_name``) that allows more fine grained
+control over who has read only access. It takes one argument, the
+request object, and should return True to restrict the user to only
+allow ``GET``, ``HEAD`` and ``OPTIONS`` requests.
+
+It is optional, and if it is not present, ``READ_ONLY`` setting value
+applies.
+
::
USE_HTTP_REFERER
M impersonate/__init__.py +1 -1
@@ 1,5 1,5 @@
# -*- coding: utf-8 -*-
-VERSION = (1, 8, 2, 'final', 0)
+VERSION = (1, 9, 0, 'final', 0)
# taken from django-registration