diff options
| author | Tom Christie | 2013-12-23 09:48:59 +0000 |
|---|---|---|
| committer | Tom Christie | 2013-12-23 09:48:59 +0000 |
| commit | 52686420f4bf866064ee88a15903665f14289394 (patch) | |
| tree | 41ea7b0d4863092f996f63de14e678a1c74a7a3a /docs/tutorial/4-authentication-and-permissions.md | |
| parent | 9c41c007afc71c899306bcb02e40bdfc36b09146 (diff) | |
| parent | 83b31e7ea298a8948e9a76c9b971845ea0052b3c (diff) | |
| download | django-rest-framework-52686420f4bf866064ee88a15903665f14289394.tar.bz2 | |
Merge branch 'bennbollay-patch-1' into 2.4.0
Conflicts:
.travis.yml
docs/api-guide/routers.md
rest_framework/compat.py
tox.ini
Diffstat (limited to 'docs/tutorial/4-authentication-and-permissions.md')
| -rw-r--r-- | docs/tutorial/4-authentication-and-permissions.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/tutorial/4-authentication-and-permissions.md b/docs/tutorial/4-authentication-and-permissions.md index b472322a..bdc6b579 100644 --- a/docs/tutorial/4-authentication-and-permissions.md +++ b/docs/tutorial/4-authentication-and-permissions.md @@ -167,10 +167,10 @@ In the snippets app, create a new file, `permissions.py` def has_object_permission(self, request, view, obj): # Read permissions are allowed to any request, # so we'll always allow GET, HEAD or OPTIONS requests. - if request.method in permissions.SAFE_METHODS: + if request.method in permissions.SAFE_METHODS: return True - - # Write permissions are only allowed to the owner of the snippet + + # Write permissions are only allowed to the owner of the snippet. return obj.owner == request.user Now we can add that custom permission to our snippet instance endpoint, by editing the `permission_classes` property on the `SnippetDetail` class: |
