Skip to content

[redwood backport] fix: CourseLimitedStaffRole should not be able to access studio. - #815

Merged
samuelallan72 merged 1 commit into
opencraft-release/redwood.1from
samuel/security-patch-redwood
Jan 19, 2026
Merged

[redwood backport] fix: CourseLimitedStaffRole should not be able to access studio.#815
samuelallan72 merged 1 commit into
opencraft-release/redwood.1from
samuel/security-patch-redwood

Conversation

@samuelallan72

Copy link
Copy Markdown
Member

We previously fixed this when the CourseLimitedStaffRole was applied to a course but did not handle the case where the role is applied to a user for a whole org. The underlying issue is that the CourseLimitedStaffRole is a subclass of the CourseStaffRole and much of the system assumes that subclesses are for giving more access not less access.

To prevent that from happening for the case of the CourseLimitedStaffRole, when we do CourseStaffRole access checks, we use the strict_role_checking context manager to ensure that we're not accidentally granting the limited_staff role too much access.

(cherry picked from commit 9091801)

We previously fixed this when the CourseLimitedStaffRole was applied to
a course but did not handle the case where the role is applied to a user
for a whole org.  The underlying issue is that the CourseLimitedStaffRole
is a subclass of the CourseStaffRole and much of the system assumes that
subclesses are for giving more access not less access.

To prevent that from happening for the case of the CourseLimitedStaffRole,
when we do CourseStaffRole access checks, we use the strict_role_checking
context manager to ensure that we're not accidentally granting the
limited_staff role too much access.

(cherry picked from commit 9091801)
@samuelallan72 samuelallan72 self-assigned this Jan 19, 2026

@Kelketek Kelketek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks like the previous backports I've seen for this.

  • I tested this: (describe what you tested)
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation
  • Added to the Code Drift project board (for backports)

@samuelallan72
samuelallan72 merged commit 3816aaa into opencraft-release/redwood.1 Jan 19, 2026
16 of 75 checks passed
@samuelallan72
samuelallan72 deleted the samuel/security-patch-redwood branch January 19, 2026 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants