Skip to content

Commit 6f28df6

Browse files
gythaoggb1rger
authored andcommitted
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
1 parent f2e0b2f commit 6f28df6

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed

docs/source/configuration.rst

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -98,42 +98,15 @@ APIS_NEXT_PREV
9898
APIS_NEXT_PREV = True
9999
100100
101-
APIS_LIST_VIEWS_ALLOWED
101+
APIS_ANON_VIEWS_ALLOWED
102102
^^^^^^^^^^^^^^^^^^^^^^^
103103

104104
.. code-block:: python
105105
106-
APIS_LIST_VIEWS_ALLOWED = False
106+
APIS_ANON_VIEWS_ALLOWED = False
107107
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>`_.
137110

138111

139112
Maintenance Middleware

0 commit comments

Comments
 (0)