Skip to content

Commit 6de33ef

Browse files
Doc’d requirement to implement has_object_permission() (#6462)
…when using provided permission classes. Closes #6402.
1 parent eb31801 commit 6de33ef

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/api-guide/permissions.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@ For example:
4848
self.check_object_permissions(self.request, obj)
4949
return obj
5050

51+
---
52+
53+
**Note**: With the exception of `DjangoObjectPermissions`, the provided
54+
permission classes in `rest_framework.permssions` **do not** implement the
55+
methods necessary to check object permissions.
56+
57+
If you wish to use the provided permission classes in order to check object
58+
permissions, **you must** subclass them and implement the
59+
`has_object_permission()` method described in the [_Custom
60+
permissions_](#custom-permissions) section (below).
61+
62+
---
63+
5164
#### Limitations of object level permissions
5265

5366
For performance reasons the generic views will not automatically apply object level permissions to each instance in a queryset when returning a list of objects.

0 commit comments

Comments
 (0)