feat: modify user role api
Adds a new API to modify role of learners.
Test instructions
- Setup nutmeg devstack with edx-platform pointing to
opencraft-release/nutmeg.2
branch. - Get lms up and running using
make lms-up
. - Open shell in lms using
make lms-shell
. - Clone this repo in
<devstack-base-dir>/src/ytp_api
- Install this inside lms container using
pip install -e /edx/src/ytp_api
- 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
- Scroll to bottom and check that no users are added under
Course Team Management
. - 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"
}
- It should run successfully and you can confirm it in instructor dashboard, the user edx should be displayed.
- Follow steps 8 and 9 with action as
revoke
and confirm that the user access is revoked.
Edited by Navin Karkera