mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 00:04:16 +03:00
Tweak
This commit is contained in:
parent
a574dc7f85
commit
043d748b53
|
@ -153,7 +153,7 @@ class TokenHasReadWriteScope(BasePermission):
|
||||||
elif hasattr(token, 'scope'): # OAuth 2
|
elif hasattr(token, 'scope'): # OAuth 2
|
||||||
required = oauth2_constants.READ if read_only else oauth2_constants.WRITE
|
required = oauth2_constants.READ if read_only else oauth2_constants.WRITE
|
||||||
return oauth2_provider_scope.check(required, request.auth.scope)
|
return oauth2_provider_scope.check(required, request.auth.scope)
|
||||||
else:
|
|
||||||
assert False, ('TokenHasReadWriteScope requires either the'
|
assert False, ('TokenHasReadWriteScope requires either the'
|
||||||
'`OAuthAuthentication` or `OAuth2Authentication` authentication '
|
'`OAuthAuthentication` or `OAuth2Authentication` authentication '
|
||||||
'class to be used.')
|
'class to be used.')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user