summaryrefslogtreecommitdiff
path: root/docs/topics
diff options
context:
space:
mode:
authorolivierdalang <olivier.dalang@gmail.com>2018-05-02 20:39:12 +1200
committerTim Graham <timograham@gmail.com>2018-05-16 06:44:55 -0400
commit825f0beda804e48e9197fcf3b0d909f9f548aa47 (patch)
treebe5036c256efa1cd06a72b3265ed97884afc39cb /docs/topics
parent35b6a348dea6b019679fe35fd443be875bdb028e (diff)
Fixed #8936 -- Added a view permission and a read-only admin.
Co-authored-by: Petr Dlouhy <petr.dlouhy@email.cz> Co-authored-by: Olivier Dalang <olivier.dalang@gmail.com>
Diffstat (limited to 'docs/topics')
-rw-r--r--docs/topics/auth/default.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/topics/auth/default.txt b/docs/topics/auth/default.txt
index 9f864c64d7..94a8fc592f 100644
--- a/docs/topics/auth/default.txt
+++ b/docs/topics/auth/default.txt
@@ -158,6 +158,8 @@ code.
The Django admin site uses permissions as follows:
+* Access to view objects is limited to users with the "view" or "change"
+ permission for that type of object.
* Access to view the "add" form and add an object is limited to users with
the "add" permission for that type of object.
* Access to view the change list, view the "change" form and change an
@@ -168,6 +170,7 @@ The Django admin site uses permissions as follows:
Permissions can be set not only per type of object, but also per specific
object instance. By using the
+:meth:`~django.contrib.admin.ModelAdmin.has_view_permission`,
:meth:`~django.contrib.admin.ModelAdmin.has_add_permission`,
:meth:`~django.contrib.admin.ModelAdmin.has_change_permission` and
:meth:`~django.contrib.admin.ModelAdmin.has_delete_permission` methods provided
@@ -213,6 +216,7 @@ to test for basic permissions you should use:
* add: ``user.has_perm('foo.add_bar')``
* change: ``user.has_perm('foo.change_bar')``
* delete: ``user.has_perm('foo.delete_bar')``
+* view: ``user.has_perm('foo.view_bar')``
The :class:`~django.contrib.auth.models.Permission` model is rarely accessed
directly.