Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
25d8085b
Commit
25d8085b
authored
Jul 21, 2016
by
Amir Qayyum Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed authentication classes to support Django OAUTH Toolkit
parent
046ee7bd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
lms/djangoapps/ccx/api/v0/tests/test_views.py
+0
-0
lms/djangoapps/ccx/api/v0/views.py
+14
-5
No files found.
lms/djangoapps/ccx/api/v0/tests/test_views.py
View file @
25d8085b
This diff is collapsed.
Click to expand it.
lms/djangoapps/ccx/api/v0/views.py
View file @
25d8085b
...
...
@@ -9,11 +9,9 @@ from django.contrib.auth.models import User
from
django.db
import
transaction
from
django.http
import
Http404
from
rest_framework
import
status
from
rest_framework.authentication
import
SessionAuthentication
from
rest_framework.generics
import
GenericAPIView
from
rest_framework.permissions
import
IsAuthenticated
from
rest_framework.response
import
Response
from
rest_framework_oauth.authentication
import
OAuth2Authentication
from
ccx_keys.locator
import
CCXLocator
from
courseware
import
courses
...
...
@@ -26,7 +24,10 @@ from lms.djangoapps.instructor.enrollment import (
from
opaque_keys
import
InvalidKeyError
from
opaque_keys.edx.keys
import
CourseKey
,
UsageKey
from
openedx.core.djangoapps.content.course_overviews.models
import
CourseOverview
from
openedx.core.lib.api
import
permissions
from
openedx.core.lib.api
import
(
authentication
,
permissions
,
)
from
student.models
import
CourseEnrollment
from
student.roles
import
CourseCcxCoachRole
...
...
@@ -363,7 +364,11 @@ class CCXListView(GenericAPIView):
]
}
"""
authentication_classes
=
(
JwtAuthentication
,
OAuth2Authentication
,
SessionAuthentication
,)
authentication_classes
=
(
JwtAuthentication
,
authentication
.
OAuth2AuthenticationAllowInactiveUser
,
authentication
.
SessionAuthenticationAllowInactiveUser
,
)
permission_classes
=
(
IsAuthenticated
,
permissions
.
IsMasterCourseStaffInstructor
)
serializer_class
=
CCXCourseSerializer
pagination_class
=
CCXAPIPagination
...
...
@@ -609,7 +614,11 @@ class CCXDetailView(GenericAPIView):
response is returned.
"""
authentication_classes
=
(
JwtAuthentication
,
OAuth2Authentication
,
SessionAuthentication
,)
authentication_classes
=
(
JwtAuthentication
,
authentication
.
OAuth2AuthenticationAllowInactiveUser
,
authentication
.
SessionAuthenticationAllowInactiveUser
,
)
permission_classes
=
(
IsAuthenticated
,
permissions
.
IsCourseStaffInstructor
)
serializer_class
=
CCXCourseSerializer
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment