Contentnode `requisites` action skips the permission check

Abierto Apto para principiantes
#6,400 3 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@sreehari-vp ya está trabajando en esto.

Desde el 17/11/2026.

  • #6426 de @sreehari-vp — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python

Línea de trabajo

Lee ContentNodeViewSet.requisites en contentcuration/contentcuration/viewsets/contentnode.py y sigue el patrón de acceso de get_object() en el issue #6398. Añade pruebas de regresión para un usuario que no es miembro, un usuario con permiso de visualización y un nodo inexistente; confirma que los usuarios que no son miembros reciben 404, mientras que los usuarios con permiso de visualización conservan la respuesta existente.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

community-contribution-in-progress DEV: backend good first issue help wanted

🙂 Looking for an issue? Welcome! This issue is open for contribution. If this is the first time you’re requesting an issue, please:

  • Read Contributing guidelines carefully. Pay extra attention to Using generative AI. Pull requests and comments that don’t follow the guidelines won’t be answered.
  • Confirm that you’ve read the guidelines in your comment.

Overview

The contentnode requisites action finds the node's tree with ContentNode.filter_by_pk rather than get_object(). Any logged-in user can read the prerequisite relationships of a channel tree they can't view, given the id of a node in it.

Complexity: Low
Target branch: hotfixes

Context
  • ContentNodeViewSet.requisites filters PrerequisiteContentRelationship by the tree of the unscoped node.
  • Reproduced: a logged-in user with no access to a private channel gets 200 with every target/prerequisite id pair in its tree from GET /api/contentnode/<id>/requisites.
The Change
  • requisites should load the node through get_object(), following the strategy in #6398, and take the tree from that node.
Acceptance Criteria
General
  • A logged-in user who can't view the node gets 404 from GET /api/contentnode/<id>/requisites, the same as for a nonexistent id.
  • Editors and viewers of the channel get the same response as before.
Testing
  • Regression tests cover a non-member, a viewer and a nonexistent id.

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.

Lenguaje dominante
Python
Estrellas
212
Forks
321
Merge medio
1 d 7 h
PR fusionados (30 d)
14

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de learningequality/studio

Todos los issues de learningequality/studio

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.