Channel `language_exists` and `languages` actions skip the channel permission check

Abierto Apto para principiantes
#6,399 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

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

Línea de trabajo

Empieza con las acciones channel_language_exists y get_languages_in_channel en contentcuration/contentcuration/viewsets/channel.py y luego compara cómo usan get_object() las otras acciones de detalle. Actualiza ambas acciones para que apliquen la misma comprobación de acceso al canal. Añade pruebas de regresión para un usuario que no sea miembro, un viewer y un ID de canal inexistente; el trabajo estará terminado cuando ambas acciones devuelvan 404 para los canales inaccesibles y mantengan las respuestas para viewers y editores.

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

Descripción

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 channel language_exists and languages actions load the channel through Channel.objects rather than get_object(). Any logged-in user can read the content languages of a private channel they can't view, given its id, and the response also shows whether that channel id exists. The other detail actions on the viewset use get_object().

Complexity: Low
Target branch: hotfixes

Context
The Change
  • Both actions should load the channel through get_object(), following the strategy in #6398, so a user who can't view the channel gets the same 404 as GET /api/channel/<id>.
Acceptance Criteria
General
  • A logged-in user who can't view a channel gets 404 from both GET /api/channel/<id>/languages and GET /api/channel/<id>/language_exists, the same as for a nonexistent channel id.
  • Editors and viewers of the channel get the same responses as before.
Testing
  • Regression tests cover a non-member, a viewer and a nonexistent id for both actions.

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.