Compare commits

..

No commits in common. "ae2f82a93b936ee056aceb6ddcf498d33ff57ef9" and "363c60c382d0f0e345934d8aa2f79287d7e2afb7" have entirely different histories.

2 changed files with 18 additions and 18 deletions

View File

@ -40,12 +40,12 @@ CORS_ALLOW_ALL_ORIGINS = True
# ]
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'DEFAULT_AUTHENTICATION_CLASSES': [
'oauth2_provider.contrib.rest_framework.OAuth2Authentication',
),
'DEFAULT_PERMISSION_CLASSES': (
],
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthenticated',
)
],
}
OAUTH2_PROVIDER = {

View File

@ -17,16 +17,16 @@ from jobposting.serializers import (
)
class MyUserViewSet(viewsets.ModelViewSet):
authentication_classes = [OAuth2Authentication]
permission_classes = [TokenHasReadWriteScope]
authentication_classes = [OAuth2ClientCredentialAuthentication]
# permission_classes = [TokenHasReadWriteScope] # test only
queryset = MyUser.objects.all()
serializer_class = MyUserSerializer
required_scope = ['main']
# required_scope = ['main']
# permission_classes = [permissions.IsAuthenticated]
class JobListingViewSet(viewsets.ModelViewSet):
authentication_classes = [OAuth2Authentication]
permission_classes = [TokenHasReadWriteScope] # test only
authentication_classes = [OAuth2ClientCredentialAuthentication]
# permission_classes = [TokenHasReadWriteScope] # test only
queryset = JobListing.objects.all()
serializer_class = JobListingSerializer
required_scope = ['main']
@ -52,11 +52,11 @@ class JobListingViewSet(viewsets.ModelViewSet):
serializer.save(anonymous_user_data=anonymous_user_data)
class SkillLevelsViewSet(viewsets.ModelViewSet):
authentication_classes = [OAuth2Authentication]
permission_classes = [TokenHasReadWriteScope] # test only
authentication_classes = [OAuth2ClientCredentialAuthentication]
# permission_classes = [TokenHasReadWriteScope] # test only
queryset = SkillLevels.objects.all()
serializer_class = SkillLevelsSerializer
required_scope = ['main']
# required_scope = ['main']
# permission_classes = [permissions.IsAuthenticatedOrReadOnly]
@ -73,16 +73,16 @@ class SkillLevelsViewSet(viewsets.ModelViewSet):
return super().create(request, *args, **kwargs)
class CompanyLogoViewSet(viewsets.ModelViewSet):
authentication_classes = [OAuth2Authentication]
permission_classes = [TokenHasReadWriteScope]
authentication_classes = [OAuth2ClientCredentialAuthentication]
# permission_classes = [TokenHasReadWriteScope]
queryset = CompanyLogo.objects.all()
serializer_class = CompanyLogoSerializer
required_scope = ['main']
# required_scope = ['main']
class SkillViewset(viewsets.ModelViewSet):
authentication_classes = [OAuth2Authentication]
permission_classes = [TokenHasReadWriteScope]
authentication_classes = [OAuth2ClientCredentialAuthentication]
# permission_classes = [TokenHasReadWriteScope]
queryset = Skill.objects.all()
serializer_class = SkillSerializer
required_scope = ['main']
# required_scope = ['main']