@@ -72,7 +72,8 @@ admin class
72
72
Disabling the option to revert an object
73
73
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74
74
75
- By default, an object can be reverted to its previous version. To disable this option globally update your settings with the following:
75
+ By default, an object can be reverted to its previous version. To disable this option
76
+ globally, update your settings with the following:
76
77
77
78
.. code-block :: python
78
79
@@ -82,19 +83,20 @@ When ``SIMPLE_HISTORY_REVERT_DISABLED`` is set to ``True``, the revert button is
82
83
83
84
.. image :: screens/10_revert_disabled.png
84
85
85
- Enabling history model permissions in Admin
86
+ Enforcing history model permissions in Admin
86
87
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
87
88
88
- To have admin evaluate history model permissions explicitly, updating your settings
89
- with the following:
89
+ To make the Django admin site evaluate history model permissions explicitly,
90
+ update your settings with the following:
90
91
91
92
.. code-block :: python
92
93
93
94
SIMPLE_HISTORY_ENFORCE_HISTORY_MODEL_PERMISSIONS = True
94
95
95
- By default ``SIMPLE_HISTORY_ENFORCE_HISTORY_MODEL_PERMISSIONS `` is set to ``False ``.
96
- When set to ``False ``, permissions applied to the ``Poll `` model also apply to the
97
- history model. That is, granting view and change permissions to the ``Poll `` model
96
+ By default, ``SIMPLE_HISTORY_ENFORCE_HISTORY_MODEL_PERMISSIONS `` is set to ``False ``.
97
+ When set to ``False ``, permissions applied to the ``Poll `` model
98
+ (from the examples above), also apply to the history model.
99
+ That is, granting view and change permissions to the ``Poll `` model
98
100
implicitly grants view and change permissions to the ``Poll `` history model.
99
101
100
102
The user below has view and change permissions to the ``Poll `` model and the ``Poll ``
@@ -118,11 +120,11 @@ in admin.
118
120
Permission.objects.get(codename = " view_poll" ),
119
121
)
120
122
121
- When ``SIMPLE_HISTORY_ENFORCE_HISTORY_MODEL_PERMISSIONS `` is set to ``True ``, permissions to
122
- history models are assigned and evaluated explicitly.
123
+ When ``SIMPLE_HISTORY_ENFORCE_HISTORY_MODEL_PERMISSIONS `` is set to ``True ``,
124
+ permissions to history models are assigned and evaluated explicitly.
123
125
124
- The user below *does not have * permission to the ``Poll `` history model in admin even
125
- though they *have * view permission to the ``Poll `` model.
126
+ The user below *does not have * view permission to the ``Poll `` history model in admin,
127
+ even though they *have * view permission to the ``Poll `` model.
126
128
127
129
.. code-block :: python
128
130
@@ -144,9 +146,9 @@ history model.
144
146
Permission.objects.get(codename = " view_historicalpoll" ),
145
147
)
146
148
147
- The user below has view permission to the ``Poll `` history model but will need to
148
- access the instance with a direct url since the ``Poll `` model will not be listed in
149
- the admin application index page nor the ``Poll `` changelist.
149
+ The user below has view permission to the ``Poll `` history model, but will need to
150
+ access the page with a direct URL, since the ``Poll `` model will not be listed on
151
+ the admin application index page, nor the ``Poll `` changelist.
150
152
151
153
.. code-block :: python
152
154
0 commit comments