mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-06-06 14:43:06 +03:00
Update docs/api-guide/permissions.md
@permission_classes takes a tuple or list.
This commit is contained in:
parent
3e3ede71d2
commit
3868241f6a
|
@ -53,7 +53,7 @@ You can also set the authentication policy on a per-view basis, using the `APIVi
|
||||||
Or, if you're using the `@api_view` decorator with function based views.
|
Or, if you're using the `@api_view` decorator with function based views.
|
||||||
|
|
||||||
@api_view('GET')
|
@api_view('GET')
|
||||||
@permission_classes(IsAuthenticated)
|
@permission_classes((IsAuthenticated, ))
|
||||||
def example_view(request, format=None):
|
def example_view(request, format=None):
|
||||||
content = {
|
content = {
|
||||||
'status': 'request was permitted'
|
'status': 'request was permitted'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user