diff options
Diffstat (limited to 'docs/tutorial/4-authentication-and-permissions.md')
| -rw-r--r-- | docs/tutorial/4-authentication-and-permissions.md | 6 | 
1 files changed, 1 insertions, 5 deletions
| diff --git a/docs/tutorial/4-authentication-and-permissions.md b/docs/tutorial/4-authentication-and-permissions.md index e9e5246a..979421ea 100644 --- a/docs/tutorial/4-authentication-and-permissions.md +++ b/docs/tutorial/4-authentication-and-permissions.md @@ -161,11 +161,7 @@ In the snippets app, create a new file, `permissions.py`          Custom permission to only allow owners of an object to edit it.          """ -        def has_permission(self, request, view, obj=None): -            # Skip the check unless this is an object-level test -            if obj is None: -                return True -     +        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:             | 
