aboutsummaryrefslogtreecommitdiffstats
path: root/docs/api-guide/permissions.md
diff options
context:
space:
mode:
authorTom Christie2013-04-30 14:34:28 +0100
committerTom Christie2013-04-30 14:34:28 +0100
commitb65b065375796919a57f4bd6f1dd8187ef0eb165 (patch)
tree7da258c8dd5dbee05ab88b126b53b67dd5ce5720 /docs/api-guide/permissions.md
parent8dff8d2fdcfcee356c134f4be8235d2a4f122d1a (diff)
downloaddjango-rest-framework-b65b065375796919a57f4bd6f1dd8187ef0eb165.tar.bz2
Add DjangoModelPermissionsOrAnonReadOnly
Diffstat (limited to 'docs/api-guide/permissions.md')
-rw-r--r--docs/api-guide/permissions.md9
1 files changed, 4 insertions, 5 deletions
diff --git a/docs/api-guide/permissions.md b/docs/api-guide/permissions.md
index 4b3eda6d..5dbaf338 100644
--- a/docs/api-guide/permissions.md
+++ b/docs/api-guide/permissions.md
@@ -96,16 +96,15 @@ This permission class ties into Django's standard `django.contrib.auth` [model p
* `POST` requests require the user to have the `add` permission on the model.
* `PUT` and `PATCH` requests require the user to have the `change` permission on the model.
* `DELETE` requests require the user to have the `delete` permission on the model.
-
-If you want to use `DjangoModelPermissions` but also allow unauthenticated users to have read permission, override the class and set the `authenticated_users_only` property to `False`. For example:
-
- class HasModelPermissionsOrReadOnly(DjangoModelPermissions):
- authenticated_users_only = False
The default behaviour can also be overridden to support custom model permissions. For example, you might want to include a `view` model permission for `GET` requests.
To use custom model permissions, override `DjangoModelPermissions` and set the `.perms_map` property. Refer to the source code for details.
+## DjangoModelPermissionsOrAnonReadOnly
+
+Similar to `DjangoModelPermissions`, but also allows unauthenticated users to have read-only access to the API.
+
## TokenHasReadWriteScope
This permission class is intended for use with either of the `OAuthAuthentication` and `OAuth2Authentication` classes, and ties into the scoping that their backends provide.