mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
IsAdmin permissions changed to IsAdminUser (#8227)
Documentation change to keep up with the code permission changes. Co-authored-by: Jeremy Langley <jlangley2code@gmail.com>
This commit is contained in:
parent
dabf2216c3
commit
37b73ef46e
|
@ -125,7 +125,7 @@ You may inspect these attributes to adjust behaviour based on the current action
|
|||
if self.action == 'list':
|
||||
permission_classes = [IsAuthenticated]
|
||||
else:
|
||||
permission_classes = [IsAdmin]
|
||||
permission_classes = [IsAdminUser]
|
||||
return [permission() for permission in permission_classes]
|
||||
|
||||
## Marking extra actions for routing
|
||||
|
|
|
@ -110,7 +110,7 @@ You can now compose permission classes using the and/or operators, `&` and `|`.
|
|||
For example...
|
||||
|
||||
```python
|
||||
permission_classes = [IsAuthenticated & (ReadOnly | IsAdmin)]
|
||||
permission_classes = [IsAuthenticated & (ReadOnly | IsAdminUser)]
|
||||
```
|
||||
|
||||
If you're using custom permission classes then make sure that you are subclassing
|
||||
|
|
Loading…
Reference in New Issue
Block a user