Skip to content

feat: modify user role api

Navin Karkera requested to merge navin/modify-access-api into opencraft-release/maple.3

Adds a new API to modify role of learners.

Test instructions

  1. Setup nutmeg devstack with edx-platform pointing to opencraft-release/nutmeg.2 branch.
  2. Get lms up and running using make lms-up.
  3. Open shell in lms using make lms-shell.
  4. Clone this repo in <devstack-base-dir>/src/ytp_api
  5. Install this inside lms container using pip install -e /edx/src/ytp_api
  6. Login to admin via http://localhost:18000/admin and open instructor page for demo course: http://localhost:18000/courses/course-v1:edX+DemoX+Demo_Course/instructor#view-membership
  7. Scroll to bottom and check that no users are added under Course Team Management.
  8. Open http://localhost:18000/api/user/modify_access and enter below json in content field
{
  "username_or_email": "edx",
  "rolename": "staff",
  "action": "allow",
  "course_id": "course-v1:edX+DemoX+Demo_Course"
}
  1. It should run successfully and you can confirm it in instructor dashboard, the user edx should be displayed.
  2. Follow steps 8 and 9 with action as revoke and confirm that the user access is revoked.
Edited by Navin Karkera

Merge request reports