openedx / openedx/openedx-authz
feat: properly implement staff/superuser listing and filtering in assignments API
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 0
- Forks
- 9
- Avg merge
- 13d 9h
- Merged PRs (30d)
- 9
Description
Context
AssignmentsAPIView previously returned staff/superuser entries (SuperAdminAssignmentData) alongside regular role assignments, these entries bypassed all org/scope/role filters because they are not Casbin-backed so they were fetched in a separate call.
PR #345 removed them from the list endpoint as a short-term fix to unblock a release.
What needs to be done
Design and implement proper listing and filtering behavior for staff/superuser entries in the assignments list endpoint:
- Define what it means to filter a
SuperAdminAssignmentDataby org, scope, and role (these entries have no Casbin policy behind them). - Ensure superadmin entries are either included or excluded consistently with whatever filter is active, without bypassing the filter logic.
- Ensure users can only review scopes they have access to.
- Add or restore test coverage for the filtering behavior.
Current state
SuperAdminAssignmentDataandget_superadmin_assignments()still exist and are used byTeamMemberAssignmentsAPIView.- The list endpoint returns only
RoleAssignmentDataentries. - Serializer support for
SuperAdminAssignmentData(role, org, scope, is_superadmin fields) is still in place.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with AssignmentsAPIView, TeamMemberAssignmentsAPIView, SuperAdminAssignmentData, and get_superadmin_assignments(). Trace how RoleAssignmentData is filtered and how serializer support represents superadmin entries. Define consistent org, scope, and role behavior, enforce accessible scopes, and add or restore tests covering the filtering behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, authorization, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100