Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(redwood): backport instructor APIs conversion to DRF #725

Open
wants to merge 3 commits into
base: opencraft-release/redwood.1
Choose a base branch
from

Conversation

Agrendalath
Copy link
Member

@Agrendalath Agrendalath commented Jan 6, 2025

This backports the conversion of the instruction APIs to REST.

Testing instructions

  1. Visit the Instructor dashboard (http://local.edly.io:8000/courses/course-v1:OpenedX+DemoX+DemoCourse/instructor#view-membership) and check that assigning and revoking course roles works correctly.
  2. Retrieve the JWT token with curl -X POST -d "grant_type=password&client_id=login-service-client-id&username=<username>&password=<password>&token_type=jwt" http://local.edly.io:8000/oauth2/access_token (replace the username and password with the correct values).
  3. Assuming the audit user exists and you have a course course-v1:edX+DemoX+Demo_Course, use the following request to assign a course role: curl -X POST -H "Authorization: JWT <token>" -d "rolename=staff&action=allow&unique_student_identifier=audit" http://local.edly.io:8000/courses/course-v1:OpenedX+DemoX+DemoCourse/instructor/api/modify_access
  4. Check that the role is assigned with curl -X POST -H "Authorization: JWT <token>" -d "rolename=staff" http://local.edly.io:8000/courses/course-v1:OpenedX+DemoX+DemoCourse/instructor/api/list_course_role_members
  5. Revoke the role with: curl -X POST -H "Authorization: JWT <token>" -d "rolename=staff&action=revoke&unique_student_identifier=audit" http://local.edly.io:8000/courses/course-v1:OpenedX+DemoX+DemoCourse/instructor/api/modify_access
  6. Check that the role is no longer assigned with curl -X POST -H "Authorization: JWT <token>" -d "rolename=staff" http://local.edly.io:8000/courses/course-v1:OpenedX+DemoX+DemoCourse/instructor/api/list_course_role_members

Private-ref: BB-9250

Adding generic permission class. Added standard authentication classes.

(cherry picked from commit 39dd3c0)
* feat: upgrading simple api to drf compatible.

(cherry picked from commit 99760f8)
@Agrendalath Agrendalath self-assigned this Jan 6, 2025
@Agrendalath Agrendalath marked this pull request as ready for review January 21, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants