Compare commits
2 Commits
363c60c382
...
ae2f82a93b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae2f82a93b | ||
|
|
86f82cbefe |
@ -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 = {
|
||||
|
||||
@ -17,16 +17,16 @@ from jobposting.serializers import (
|
||||
)
|
||||
|
||||
class MyUserViewSet(viewsets.ModelViewSet):
|
||||
authentication_classes = [OAuth2ClientCredentialAuthentication]
|
||||
# permission_classes = [TokenHasReadWriteScope] # test only
|
||||
authentication_classes = [OAuth2Authentication]
|
||||
permission_classes = [TokenHasReadWriteScope]
|
||||
queryset = MyUser.objects.all()
|
||||
serializer_class = MyUserSerializer
|
||||
# required_scope = ['main']
|
||||
required_scope = ['main']
|
||||
# permission_classes = [permissions.IsAuthenticated]
|
||||
|
||||
class JobListingViewSet(viewsets.ModelViewSet):
|
||||
authentication_classes = [OAuth2ClientCredentialAuthentication]
|
||||
# permission_classes = [TokenHasReadWriteScope] # test only
|
||||
authentication_classes = [OAuth2Authentication]
|
||||
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 = [OAuth2ClientCredentialAuthentication]
|
||||
# permission_classes = [TokenHasReadWriteScope] # test only
|
||||
authentication_classes = [OAuth2Authentication]
|
||||
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 = [OAuth2ClientCredentialAuthentication]
|
||||
# permission_classes = [TokenHasReadWriteScope]
|
||||
authentication_classes = [OAuth2Authentication]
|
||||
permission_classes = [TokenHasReadWriteScope]
|
||||
queryset = CompanyLogo.objects.all()
|
||||
serializer_class = CompanyLogoSerializer
|
||||
# required_scope = ['main']
|
||||
required_scope = ['main']
|
||||
|
||||
|
||||
class SkillViewset(viewsets.ModelViewSet):
|
||||
authentication_classes = [OAuth2ClientCredentialAuthentication]
|
||||
# permission_classes = [TokenHasReadWriteScope]
|
||||
authentication_classes = [OAuth2Authentication]
|
||||
permission_classes = [TokenHasReadWriteScope]
|
||||
queryset = Skill.objects.all()
|
||||
serializer_class = SkillSerializer
|
||||
# required_scope = ['main']
|
||||
required_scope = ['main']
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user