edx-solutions/edx-platform — pull request #148 by mattdrayer (2014-07-30 04:31:19+00:00)
Title: mattdrayer/api-users-courses-roles: Added support for setting user roles

@dsego -- functionality for setting user roles. There are two perspectives which can be utilized -- Users and Courses.

To add a role, you can POST to either /api/users/(id)/roles/ (supplying course_id and role) or /api/courses/(id)/roles/ (supplying user_id and role)

You can view the list of roles for either perspective by performing a GET on the URI. You can additionally filter the set by including course_id (for users GET) or user_id (for courses GET).

To remove a role, call DELETE on the full URI for the relationship: /api/users/(id)/roles/(role)/courses/(id), and vice-versa for courses.

The two roles you can add are 'instructor' and 'staff'. I believe staff corresponds to the concept of a TA. Adding either role to a user's record will also add a corresponding forum moderator role. Removing the role will remove the user's forum moderator role.

@chrisndodge, @martynjames, @aboudreault, FYI