Repository navigation
Conversation
|
Thanks for the pull request, @BryanttV! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
59f49d2 to
faa6504
Compare
faa6504 to
fe1d708
Compare
POST /xblock/ with a duplicate_source_locator and a parent_locator from two different courses created the new block in the source course (the key is built from the source location) and attached it as a child of a parent in another course. With authz enabled the source course was never checked, so a user without access to it could write there, and the destination course was left with a dangling child that could not be loaded or deleted. - Build the key of the duplicated block in the parent's course (or library) instead of the source's. This also fixes duplicating a v1 library block into a course, which returned 200 but created the copy in the library and left the course with a dangling child. - Require view access on the source course in the xblock handler in both modes: courses.view_course when authz is enabled for the source course, has_studio_read_access otherwise (including v1 libraries). Write access on the destination is still required as before. Part of openedx/openedx-authz#602. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
fe1d708 to
8a076e8
Compare
Description
POST /xblock/with aduplicate_source_locatorand aparent_locatorfrom two different courses created the new block in the source course (the key was built from the source location) and attached it as a child of a parent in the destination course. The result was a dangling child in the destination course that could not be loaded or deleted. With AuthZ enabled, the source course was also never checked, so a user without access to it could write there.This PR:
duplicate_blockincms/djangoapps/contentstore/utils.py). This also fixes duplicating a v1 library block into a course, which returned200but created the copy in the library and left the course with a dangling child._check_duplicate_source_view_accessinxblock_storage_handlers/view_handlers.py):courses.view_coursewhen AuthZ is enabled for the source course.has_studio_read_accessotherwise, including v1 libraries, which AuthZ does not cover.Affected roles: Course Author, Course Staff, Library Author.
Behavior change: A user who can edit the destination but cannot view the source course now gets
403when duplicating across courses. When AuthZ is enabled, this check was previously skipped.Supporting Information
Testing Instructions
Create two courses,
A(source) andB(destination), each with a section, subsection, unit, and at least one component inA.Log in as a user with edit access on
Band view access onA.In
A, get the usage key of a component. InB, get the usage key of a unit.Send
POST /xblock/with this body:{ "duplicate_source_locator": "<component usage key in A>", "parent_locator": "<unit usage key in B>" }Verify the response is
200and the returnedlocatorbelongs to courseB. Verify the component appears in the unit inB, and thatAis unchanged.Remove the user's access to
Aand repeat step 4. Verify the response is403, and that nothing was created inAorB.Grant access to
Abut remove edit access onBand repeat step 4. Verify the response is403.Repeat steps 4 to 7 with AuthZ enabled for the courses (
AUTHZ_COURSE_AUTHORING_FLAG), using roles that grant or lackcourses.view_courseonAand edit permission onB.Duplicate a block from a v1 library into a course. Verify the copy is created in the course and can be loaded and deleted there.
Run the automated tests:
Deadline
Willow
Other Information