Commit eab5c607 by Alison Hodges

Merge pull request #9984 from edx/ahodges/enroll_api

Updates the description provided for a new enrollment report
parents 0219e18f adffb10c
...@@ -457,15 +457,18 @@ class EnrollmentListView(APIView, ApiKeyPermissionMixIn): ...@@ -457,15 +457,18 @@ class EnrollmentListView(APIView, ApiKeyPermissionMixIn):
"""Gets a list of all course enrollments for a user. """Gets a list of all course enrollments for a user.
Returns a list for the currently logged in user, or for the user named by the 'user' GET Returns a list for the currently logged in user, or for the user named by the 'user' GET
parameter. If the username does not match the currently logged in user, only courses the parameter. If the username does not match that of the currently logged in user, only
requesting user has staff permissions for are listed. courses for which the currently logged in user has the Staff or Admin role are listed.
As a result, a course team member can find out which of his or her own courses a particular
Only staff or instructor permissions on individual courses are taken into account when learner is enrolled in.
deciding whether the requesting user is permitted to see a particular enrollment, i.e.
organizational staff access doesn't grant permission to see the enrollments in all courses Only the Staff or Admin role (granted on the Django administrative console as the staff
of the organization. This may change in the future. or instructor permission) in individual courses gives the requesting user access to
enrollment data. Permissions granted at the organizational level do not give a user
However, users with global staff access can see all enrollments of all students. access to enrollment data for all of that organization's courses.
Users who have the global staff permission can access all enrollment data for all
courses.
""" """
username = request.GET.get('user', request.user.username) username = request.GET.get('user', request.user.username)
try: try:
......
...@@ -193,7 +193,8 @@ MOCK_MODULES = [ ...@@ -193,7 +193,8 @@ MOCK_MODULES = [
'student.auth', 'student.auth',
'ccx_keys', 'ccx_keys',
'ccx_keys.locator', 'ccx_keys.locator',
'user_api.preferences.api' 'user_api.preferences.api',
'rest_framework_oauth.authentication'
] ]
for mod_name in MOCK_MODULES: for mod_name in MOCK_MODULES:
......
...@@ -57,7 +57,7 @@ Get the User's Enrollment Status in a Course ...@@ -57,7 +57,7 @@ Get the User's Enrollment Status in a Course
Get the User's Enrollment Information for a Course Get the User's Enrollment Information for a Course
************************************************** **************************************************
.. .. autoclass:: enrollment.views.EnrollmentCourseDetailView .. autoclass:: enrollment.views.EnrollmentCourseDetailView
**Example response showing a user's course enrollment information** **Example response showing a user's course enrollment information**
...@@ -160,7 +160,7 @@ View a User's Enrollments or Enroll a User in a Course ...@@ -160,7 +160,7 @@ View a User's Enrollments or Enroll a User in a Course
.. code-block:: json .. code-block:: json
{ {
“course_details”: { "course_details": {
“course_id”: “edX/DemoX/Demo_Course” "course_id": "edX/DemoX/Demo_Course"
} }
} }
\ No newline at end of file
...@@ -31,20 +31,16 @@ The Enrollment API supports the following tasks, methods, and endpoints. ...@@ -31,20 +31,16 @@ The Enrollment API supports the following tasks, methods, and endpoints.
* - Task * - Task
- Method - Method
- Endpoint - Endpoint
* - :ref:`Get the user's enrollment status in a course * - :ref:`Get the user's enrollment status in a course <Get the Users Enrollment Status in a Course>`
<Get the Users Enrollment Status in a Course>`
- GET - GET
- /api/enrollment/v1/enrollment/{user_id},{course_id} - /api/enrollment/v1/enrollment/{user_id},{course_id}
* - :ref:`Get the user's enrollment information for a course * - :ref:`Get the user's enrollment information for a course <Get Enrollment Details for a Course>`
<Get Enrollment Details for a Course>`
- GET - GET
- /api/enrollment/v1/course/{course_id} - /api/enrollment/v1/course/{course_id}
* - :ref:`View a user's enrollments * - :ref:`View a user's enrollments <View and add to a Users Course Enrollments>`
<View and add to a Users Course Enrollments>`
- GET - GET
- /api/enrollment/v1/enrollment - /api/enrollment/v1/enrollment
* - :ref:`Enroll a user in a course * - :ref:`Enroll a user in a course <View and add to a Users Course Enrollments>`
<View and add to a Users Course Enrollments>`
- POST - POST
- /api/enrollment/v1/enrollment{“course_details”:{“course_id”:“*course_id*”}} - /api/enrollment/v1/enrollment{"course_details":{"course_id":"{course_id}"}}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment