diff options
| author | Tom Christie | 2013-12-23 12:37:56 +0000 |
|---|---|---|
| committer | Tom Christie | 2013-12-23 12:37:56 +0000 |
| commit | 66cc2d3d5d611c57638a59932cd65c62d9b130c2 (patch) | |
| tree | 9856f0c766c51f45e753dd8a6c01844879c5c0b4 /tutorial/4-authentication-and-permissions.html | |
| parent | e6fd79fd88067d830886f9c463d5b9e5c13d7ce3 (diff) | |
| download | django-rest-framework-66cc2d3d5d611c57638a59932cd65c62d9b130c2.tar.bz2 | |
Switch title ordering.
Diffstat (limited to 'tutorial/4-authentication-and-permissions.html')
| -rw-r--r-- | tutorial/4-authentication-and-permissions.html | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tutorial/4-authentication-and-permissions.html b/tutorial/4-authentication-and-permissions.html index 6e166c08..dc1e2212 100644 --- a/tutorial/4-authentication-and-permissions.html +++ b/tutorial/4-authentication-and-permissions.html @@ -2,7 +2,7 @@ <html lang="en"> <head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta charset="utf-8"> - <title>Django REST framework - Tutorial 4: Authentication & Permissions</title> + <title>Tutorial 4: Authentication & Permissions - Django REST framework</title> <link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon"> <link rel="canonical" href="http://django-rest-framework.org/tutorial/4-authentication-and-permissions"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"> @@ -337,10 +337,10 @@ class IsOwnerOrReadOnly(permissions.BasePermission): 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 </code></pre> <p>Now we can add that custom permission to our snippet instance endpoint, by editing the <code>permission_classes</code> property on the <code>SnippetDetail</code> class:</p> |
