Contentnode `requisites` action skips the permission check

Aberta Para iniciantes
#6,400 3 comentários 0 reações 1 responsável Ver no GitHub

Mantenedores costumam responder em até 1 dia

@sreehari-vp já está trabalhando nisso.

Desde 17/11/2026.

  • #6426 de @sreehari-vp — aberto

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
78/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
python

Direção de pesquisa

Leia ContentNodeViewSet.requisites em contentcuration/contentcuration/viewsets/contentnode.py e siga o padrão de acesso de get_object() na issue #6398. Adicione testes de regressão para um usuário que não é membro, um usuário com permissão de visualização e um nó inexistente; confirme que usuários que não são membros recebem 404, enquanto os usuários com permissão de visualização mantêm a resposta existente.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
Python
Estrelas
212
Forks
321
Merge médio
1d 7h
PRs com merge (30d)
14

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de learningequality/studio

Todas as issues de learningequality/studio

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.