Import search returns nodes from channels the user can't view

Offen
#6,419 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
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
1/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python

Rechercherichtung

Read SearchContentNodeViewSet in contentcuration/search/viewsets/contentnode.py and follow the access strategy in issue #6398. Add regression coverage for list searches with and without channel_list, filtering by an inaccessible channel, and the detail route; verify visible and public channel results remain unchanged. The issue header says this is not open for contribution, so a newcomer should find a suitable issue through the linked contributing guidelines.

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

Import search (/api/search/search) runs over every published channel in the full-text index. It limits results to channels the user can view only when the client sends channel_list, so any logged-in user can list the nodes of published channels they haven't been given access to in Studio.

Complexity: Low
Target branch: hotfixes

Context
  • SearchContentNodeViewSet uses ContentNodeFullTextSearch.objects.all() as its queryset. The detail route uses the same queryset.
  • Reproduced: a user with no access to an unlisted published channel got its nodes, with ids, kinds and original_channel_name, from ?channel_id__in=<its id>, from ?kinds=topic, and from ?keywords=… without channel_list.
The Change
  • Search should only return nodes from channels the requesting user can view, whatever filters the client sends, following the strategy in #6398.
Acceptance Criteria
General
  • A user gets no results from a channel they can't view, with or without channel_list, including when filtering by that channel's id.
  • GET /api/search/search/<id> for a node in a channel the user can't view returns 404.
  • Results for channels the user can view, including public channels, are unchanged.
Testing
  • Regression tests cover each criterion.

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.