-
Notifications
You must be signed in to change notification settings - Fork 4.3k
fix: course editor gets 403 copying a unit to the clipboard #39075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mariajgrimaldi
merged 2 commits into
openedx:master
from
eduNEXT:ks/issue-403-editor-clipboard-403
Sep 10, 2026
+50
−2
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure if
COURSES_VIEW_COURSEis the right permission to validate here, since the Course Auditor could also use the endpoint, and in theory, that role should only have view permissions. Maybe we should check forCOURSES_EDIT_COURSEinstead?I'd like to get Product's perspective on this @gviedma-aulasneo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BryanttV @rodmgwgu
Once a user is able to view the course content, the “copy” action is really just a faster way to replicate that content. I don’t see much harm in allowing users with view access to copy it as well.
That said, it is a bit “dirty” to tie the action to a permission that technically represents something else. It sounds like a fairly niche permission to split out and validate separately, though.
So let’s proceed with the view permission for now, since it is the most basic permission across the authoring roles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @gviedma-aulasneo.
To clarify, this is only the copy endpoint. There's also an endpoint to paste the content into the course, which is currently restricted for the Course Auditor because they only have view permissions.
Similarly, on the frontend, all buttons and menus are currently being hidden so that the Course Auditor cannot perform any paste actions.
Considering this, I believe the correct permission to validate should be
COURSES_EDIT_COURSE, rather than the view permission. Even though the pasted content is based on existing content, it still involves adding another unit/component, etc., to the course. The way I see it, the Course Auditor shouldn't be able to do that.What do you think?
cc @rodmgwgu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a conversation with @gviedma-aulasneo, we decided that the permission to validate will be
courses.view_course(as it is now).A proposed use case is when a user is a Course Auditor for Course A and a Course Editor for Course B. The system should allow copying the content from Course A and then pasting it into Course B. Therefore, the view permission validation will be maintained. Nothing will change on the Frontend (the option will not be enabled), but it will be available in case it needs to be implemented in the future.