Contentnode `requisites` action skips the permission check

Open Beginner friendly
#6,400 3 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@sreehari-vp is already working on this.

Since Nov 17, 2026.

  • #6426 by @sreehari-vp — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Read ContentNodeViewSet.requisites in contentcuration/contentcuration/viewsets/contentnode.py and follow the get_object() access pattern in issue #6398. Add regression tests for a non-member, a viewer, and a nonexistent node; confirm non-members get 404 while viewers retain the existing response.

Written by the indexing model from the issue text.

Description

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.

Dominant language
JavaScript
Stars
214
Forks
327
Avg merge
17h 5m
Merged PRs (30d)
25

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from learningequality/studio

All issues in learningequality/studio

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.