1414
1515from oauth2_provider .contrib .rest_framework import (
1616 IsAuthenticatedOrTokenHasScope , OAuth2Authentication ,
17- TokenHasMethodScopeAlternative , TokenHasReadWriteScope ,
18- TokenHasResourceScope , TokenHasScope
17+ TokenHasReadWriteScope , TokenHasResourceScope ,
18+ TokenHasScope , TokenMatchesOASRequirements
1919)
2020from oauth2_provider .models import get_access_token_model , get_application_model
2121from oauth2_provider .settings import oauth2_settings
@@ -69,7 +69,7 @@ class ResourceScopedView(OAuth2View):
6969
7070
7171class MethodScopeAltView (OAuth2View ):
72- permission_classes = [TokenHasMethodScopeAlternative ]
72+ permission_classes = [TokenMatchesOASRequirements ]
7373 required_alternate_scopes = {
7474 "GET" : [["read" ]],
7575 "POST" : [["create" ]],
@@ -79,7 +79,7 @@ class MethodScopeAltView(OAuth2View):
7979
8080
8181class MethodScopeAltViewBad (OAuth2View ):
82- permission_classes = [TokenHasMethodScopeAlternative ]
82+ permission_classes = [TokenMatchesOASRequirements ]
8383
8484
8585class MissingAuthentication (BaseAuthentication ):
@@ -96,7 +96,7 @@ class TokenHasScopeViewWrongAuth(BrokenOAuth2View):
9696
9797
9898class MethodScopeAltViewWrongAuth (BrokenOAuth2View ):
99- permission_classes = [TokenHasMethodScopeAlternative ]
99+ permission_classes = [TokenMatchesOASRequirements ]
100100
101101
102102urlpatterns = [
0 commit comments