Update get_object() example in permissions.md

I'm a bit confused about the example that's provided in the 'Object level permissions' section.  Other examples (e.g. Tutorial 3 - Class Based Views) provided a pk to get_object().  It doesn't seem like this example has any way of identifying a specific object.  

Just in case I'm correct, I've prepared this pull request. But if I'm wrong, would it be possible for you to explain the example I modified?  

Many Thanks...
This commit is contained in:
Sanjuro Jogdeo 2017-09-07 16:02:47 -07:00 committed by GitHub
parent e2b5cef52c
commit ad1e05b36a

View File

@ -43,8 +43,8 @@ This will either raise a `PermissionDenied` or `NotAuthenticated` exception, or
For example: For example:
def get_object(self): def get_object(self, pk):
obj = get_object_or_404(self.get_queryset()) obj = get_object_or_404(self.get_queryset(), pk=pk)
self.check_object_permissions(self.request, obj) self.check_object_permissions(self.request, obj)
return obj return obj