You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(configuration): update configs for anonymous views
add documentation for APIS_ANON_VIEWS_ALLOWED
remove the following unsupported configurations from the docs
- APIS_LIST_VIEWS_ALLOWED
- APIS_DETAIL_VIEWS_ALLOWED
- APIS_VIEW_PASSES_TEST
- APIS_LIST_VIEW_OBJECT_FILTER
Copy file name to clipboardExpand all lines: docs/source/configuration.rst
+4-31Lines changed: 4 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,42 +98,15 @@ APIS_NEXT_PREV
98
98
APIS_NEXT_PREV=True
99
99
100
100
101
-
APIS_LIST_VIEWS_ALLOWED
101
+
APIS_ANON_VIEWS_ALLOWED
102
102
^^^^^^^^^^^^^^^^^^^^^^^
103
103
104
104
.. code-block:: python
105
105
106
-
APIS_LIST_VIEWS_ALLOWED=False
106
+
APIS_ANON_VIEWS_ALLOWED=False
107
107
108
-
109
-
Sets whether list views are accessible for anonymous (not logged in) users.
110
-
111
-
112
-
APIS_DETAIL_VIEWS_ALLOWED
113
-
^^^^^^^^^^^^^^^^^^^^^^^^
114
-
115
-
.. code-block:: python
116
-
117
-
APIS_DETAIL_VIEWS_ALLOWED-False
118
-
119
-
120
-
Sets whether detail views are accessible for anonymous (note logged in) users.
121
-
122
-
APIS_VIEW_PASSES_TEST
123
-
^^^^^^^^^^^^^^^^^^^^^
124
-
125
-
Allows to define a function that receives the view as an argument - including
126
-
e.g. the `request` object - and can perform checks on any of the views
127
-
attributes. The function can, based on these checks, return a boolean which
128
-
decides if the request is successful or leads to a 403 permission denied.
129
-
130
-
APIS_LIST_VIEW_OBJECT_FILTER
131
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
132
-
133
-
Allows to define a function that receives the view - including e.g. the
134
-
`request` object - and a queryset and can do custom filtering on that queryset.
135
-
This can be used to set the listviews to public using the
136
-
`APIS_LIST_VIEWS_ALLOWED` setting, but still only list specific entities.
108
+
Sets whether list and detail views are accessible for anonymous (not logged in) users.
109
+
If only a subset of the data should be exposed to the anonymous user, use `custom managers <https://docs.djangoproject.com/en/stable/topics/db/managers/#custom-managers>`_.
0 commit comments