User API lists collaborators' channel ids the requester can't view

Offen
#6,420 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
1/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
api, backend, security

Rechercherichtung

Read contentcuration/contentcuration/viewsets/user.py, especially UserViewSet and annotate_queryset, and review the strategy in issue #6398. Add regression tests for a co-editor whose other channel is hidden from the requester and for the requester's own record; done means collaborator channel IDs are filtered while own channel lists and sharing views keep working. The issue says it is not open for contribution.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

DEV: backend

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

GET /api/user/ returns, for every user the requester can see, the ids of all channels that user edits or views. A user can see their co-editors and co-viewers, so they get the ids of their collaborators' other channels, including ones they have no access to.

Complexity: Low
Target branch: hotfixes

Context
  • UserViewSet returns editable_channels and view_only_channels, which annotate_queryset aggregates over all of each user's channels.
  • Reproduced: a co-editor's GET /api/user/ response listed the other editor's full editable_channels and view_only_channels, including channels the requester couldn't open.
The Change
  • For any user other than the requester, editable_channels and view_only_channels should only list channels the requester can view, following the strategy in #6398. The frontend's sharing views read these fields, and should keep working.
Acceptance Criteria
General
  • For another user's record, editable_channels and view_only_channels contain only channels the requester can view.
  • The requester's own record still lists all their channels.
  • The channel sharing views show the same collaborators as before.
Testing
  • Regression tests cover a co-editor with a channel the requester can't view, and the requester's own record.

AI usage

I chose which audit findings belong in #6398 and set the access pattern. Claude Code found and reproduced this gap and drafted this issue.

Vorherrschende Sprache
Python
Sterne
212
Forks
321
Ø Merge
1 T. 7 Std.
Gemergte PRs (30 T.)
14

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus learningequality/studio

Alle Issues in learningequality/studio

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.