Allow Course Editors to import YouTube transcripts and surface errors

Aperta Adatta ai principianti
#597 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
authorization

Direzione di ricerca

Inizia da views/transcripts_ajax.py, in _get_item (righe 775-783), poi leggi i controlli delle autorizzazioni e i test esistenti per le viste delle trascrizioni. Aggiorna il controllo in modo che gli editor del corso con l’autorizzazione a modificare i contenuti possano controllare e importare le trascrizioni, mentre gli utenti senza tale autorizzazione continuino a ricevere 403. Aggiungi o aggiorna i test per entrambi i casi; la gestione facoltativa degli errori MFE è indicata separatamente in VideoSourceWidget/hooks.jsx.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

willow
Description

Course Editors cannot import YouTube transcripts in the video editor. Every /transcripts/* view goes through _get_item, which uses the legacy has_course_author_access, so editors get a 403. The MFE ignores the error, so the user gets no feedback.

Current Behavior

/transcripts/check returns 403 for an Editor. The MFE only shows the import card when command == "import" and ignores the failed request (VideoSourceWidget/hooks.jsx:18-27), so the import option silently never appears.

Expected Behavior

An Editor can check and import transcripts, since the video editor already requires edit permission. If a request is denied, the MFE shows an error.

Steps to reproduce
  1. Log in as a Course Editor.
  2. Open the video editor for a video with a YouTube source.
  3. Observe that the transcript import card never appears and no error is shown (/transcripts/check returns 403).
Acceptance Criteria
  • _get_item in views/transcripts_ajax.py (lines 775-783) uses user_has_course_permission(..., COURSES_EDIT_COURSE_CONTENT, ..., LegacyAuthoringPermission.WRITE) instead of has_course_author_access.
  • Editors can check and import transcripts.
  • Users without edit permission (e.g. Auditor) still get 403.
  • (MFE, optional) checkTranscriptsForImport failures surface an error to the user.
  • Tests are added or updated.
Technical Notes

All views using _get_item serve the video editor, so requiring edit permission for all of them is consistent.

Lingua principale
Python
Stelle
0
Fork
10
Merge medio
3g 23h
PR unite (30g)
21

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openedx/openedx-authz

Tutte le issue di openedx/openedx-authz

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.