openedx / openedx/openedx-authz

feat: properly implement staff/superuser listing and filtering in assignments API

Open
#347 0 comments 1 reaction 0 assignees View on GitHub

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 SuperAdminAssignmentData by 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

  • SuperAdminAssignmentData and get_superadmin_assignments() still exist and are used by TeamMemberAssignmentsAPIView.
  • The list endpoint returns only RoleAssignmentData entries.
  • Serializer support for SuperAdminAssignmentData (role, org, scope, is_superadmin fields) is still in place.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.