diff options
| author | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2026-09-01 17:44:30 +0200 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2026-09-02 16:18:16 +0200 |
| commit | 05aec0a4aa111b54b50daec64059fd18ac70b437 (patch) | |
| tree | 1881c985ff187f17eded6ebe3648a77b7f54feaf /docs/ref | |
| parent | ddb83ea0e0a22e6e0345b77d879522ee85688190 (diff) | |
Clarified scope of object-level admin view permissions.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index 0243c2b980..eb8b2a3c0f 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -1959,15 +1959,24 @@ default templates used by the :class:`ModelAdmin` views: .. method:: ModelAdmin.has_view_permission(request, obj=None) - Should return ``True`` if viewing ``obj`` is permitted, ``False`` - otherwise. If obj is ``None``, should return ``True`` or ``False`` to - indicate whether viewing of objects of this type is permitted in general - (e.g., ``False`` will be interpreted as meaning that the current user is - not permitted to view any object of this type). + Should return ``True`` if the user is permitted to access the change or + history view for ``obj``, and ``False`` otherwise. If obj is ``None``, + should return ``True`` or ``False`` to indicate whether viewing of objects + of this type is permitted in general (e.g., ``False`` will be interpreted + as meaning that the current user is not permitted to view any object of + this type). The default implementation returns ``True`` if the user has either the "change" or "view" permission. + .. admonition:: Object-level view permissions aren't visibility filters + + Object-level view permissions don't prevent information about an object + from appearing elsewhere in the admin, including in the admin + changelist, related field choices, autocomplete results, and recent + actions. To restrict this information, customize the querysets used by + the relevant views and form fields. + .. method:: ModelAdmin.has_add_permission(request) Should return ``True`` if adding an object is permitted, ``False`` |
