mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-26 09:14:34 +03:00
Docs tweak
This commit is contained in:
parent
e9e88cbc60
commit
7905e9f9f4
|
@ -331,8 +331,6 @@ The `ordering` attribute may be either a string or a list/tuple of strings.
|
|||
|
||||
The `DjangoObjectPermissionsFilter` is intended to be used together with the [`django-guardian`][guardian] package, with custom `'view'` permissions added. The filter will ensure that querysets only returns objects for which the user has the appropriate view permission.
|
||||
|
||||
This filter class must be used with views that provide either a `queryset` or a `model` attribute.
|
||||
|
||||
If you're using `DjangoObjectPermissionsFilter`, you'll probably also want to add an appropriate object permissions class, to ensure that users can only operate on instances if they have the appropriate object permissions. The easiest way to do this is to subclass `DjangoObjectPermissions` and add `'view'` permissions to the `perms_map` attribute.
|
||||
|
||||
A complete example using both `DjangoObjectPermissionsFilter` and `DjangoObjectPermissions` might look something like this.
|
||||
|
|
Loading…
Reference in New Issue
Block a user