New content-library response serializes can_edit_library without request context

Abierto Apto para principiantes
#39,169 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
86/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
django, python
Área
api, backend

Línea de trabajo

Empieza con LibraryRootView.post en openedx/core/djangoapps/content_libraries/rest_api/libraries.py y el método de permisos en serializers.py. Reproduce la creación de una biblioteca como creador y compara su valor de can_edit_library con el GET de detalle para el creador, el lector y los solicitantes sin permiso. Se considera terminado cuando la respuesta de creación refleja el permiso real del creador sin debilitar la autorización.

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

Descripción

Checked 2026-09-30: master source at ca039029e4918f02903b1c7d62adf8b3ad74f75b and release/verawood source at 18ce9a9c2b20c745b0ee94f615c13855acd9624b. Both carry this code path. This is a source diagnostic; no upstream full integration suite or production mutation ran.

LibraryRootView.post grants the creator admin permissions and then constructs the response serializer without request context. The serializer permission method returns false when context has no request. The library detail GET does supply request context.

Reproduction: create a v2 library as an author allowed to create libraries; inspect can_edit_library in the POST response, then fetch the detail as the same author. The create response follows the no-request/false branch despite the just-granted permissions; the context-aware detail can report the actual permission.

Expected: the successful create response reports the creator's actual edit permission, consistently with the detail response. Pass the request through get_serializer or explicit serializer context. Test creator, reader and denied caller without weakening authorization.

This report's current-source claim is the missing context and deterministic serializer false branch. No fresh end-to-end library creation ran for this filing. Duplicate checks: current issue/PR searches for LibraryRootView and can_edit_library context returned no matching report.

Lenguaje dominante
Python
Estrellas
8.2k
Forks
4.4k
Merge medio
2 d 10 h
PR fusionados (30 d)
40

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 openedx/openedx-platform

Todos los issues de openedx/openedx-platform

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.