From 6f28df6a83ce3f2a2059f52c01b2de7b9f0d35c2 Mon Sep 17 00:00:00 2001 From: Gytha Ogg Date: Wed, 18 Dec 2024 09:49:12 +0100 Subject: [PATCH] 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 --- docs/source/configuration.rst | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst index 14808f54c..a5ddd57c2 100644 --- a/docs/source/configuration.rst +++ b/docs/source/configuration.rst @@ -98,42 +98,15 @@ APIS_NEXT_PREV APIS_NEXT_PREV = True -APIS_LIST_VIEWS_ALLOWED +APIS_ANON_VIEWS_ALLOWED ^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: python - APIS_LIST_VIEWS_ALLOWED = False + APIS_ANON_VIEWS_ALLOWED = False - -Sets whether list views are accessible for anonymous (not logged in) users. - - -APIS_DETAIL_VIEWS_ALLOWED -^^^^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: python - - APIS_DETAIL_VIEWS_ALLOWED - False - - -Sets whether detail views are accessible for anonymous (note logged in) users. - -APIS_VIEW_PASSES_TEST -^^^^^^^^^^^^^^^^^^^^^ - -Allows to define a function that receives the view as an argument - including -e.g. the `request` object - and can perform checks on any of the views -attributes. The function can, based on these checks, return a boolean which -decides if the request is successful or leads to a 403 permission denied. - -APIS_LIST_VIEW_OBJECT_FILTER -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Allows to define a function that receives the view - including e.g. the -`request` object - and a queryset and can do custom filtering on that queryset. -This can be used to set the listviews to public using the -`APIS_LIST_VIEWS_ALLOWED` setting, but still only list specific entities. +Sets whether list and detail views are accessible for anonymous (not logged in) users. +If only a subset of the data should be exposed to the anonymous user, use `custom managers `_. Maintenance Middleware