Description
A Course Admin (non-superadmin) receives a 403 Forbidden error when attempting to assign or remove roles on a course scope via the Admin Console.
Affected endpoints:
PUT /api/authz/v1/roles/users/ (assign role)
DELETE /api/authz/v1/roles/users/ (remove role)
GET /api/authz/v1/roles/ (list roles — also affected)
Steps to Reproduce
- Log in as a Course Admin on a specific course (not a superadmin)
- Go to Settings > Roles and Permissions
- Use the Assign Role button to assign Course Staff to a new user on the course
- Observe a 403 error instead of a success toast
- Open an existing team member's audit view and click the trash icon to remove their assignment
- Observe a 403 error after confirming the deletion
Root Cause
Three issues in the permission layer:
@authz_permissions on the PUT/DELETE/GET methods only listed library permissions (manage_library_team, view_library). The corresponding course permissions (manage_course_team, view_course) were missing.
- No
CoursePermission class was registered for the course-v1 namespace, so DynamicScopePermission fell back to BaseScopePermission which denies by default.
DynamicScopePermission only read a single scope from requests, but the PUT endpoint now accepts a scopes list for bulk assignment.
Expected Behavior
A Course Admin should be able to assign and remove roles on courses they have management access to, matching the behavior that Library Admins already have on library scopes.
Description
A Course Admin (non-superadmin) receives a 403 Forbidden error when attempting to assign or remove roles on a course scope via the Admin Console.
Affected endpoints:
PUT /api/authz/v1/roles/users/(assign role)DELETE /api/authz/v1/roles/users/(remove role)GET /api/authz/v1/roles/(list roles — also affected)Steps to Reproduce
Root Cause
Three issues in the permission layer:
@authz_permissionson the PUT/DELETE/GET methods only listed library permissions (manage_library_team,view_library). The corresponding course permissions (manage_course_team,view_course) were missing.CoursePermissionclass was registered for thecourse-v1namespace, soDynamicScopePermissionfell back toBaseScopePermissionwhich denies by default.DynamicScopePermissiononly read a singlescopefrom requests, but the PUT endpoint now accepts ascopeslist for bulk assignment.Expected Behavior
A Course Admin should be able to assign and remove roles on courses they have management access to, matching the behavior that Library Admins already have on library scopes.