Skip to content

Conversation

@viadanna
Copy link
Member

Description

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 subclasses 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.

Supporting information

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.
Copy link
Member

@Kelketek Kelketek left a comment

Choose a reason for hiding this comment

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

👍

  • I tested this: LimitedStaff do not gain studio access.
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation
  • Added to the Code Drift project board (for backports)

@Kelketek Kelketek merged commit 5c1d31c into opencraft-release/sumac.1 Dec 16, 2025
63 of 72 checks passed
@Kelketek Kelketek deleted the viadanna/sumac/course-limited-staff-fix branch December 16, 2025 22:25
Cup0fCoffee pushed a commit that referenced this pull request Dec 17, 2025
…-staff-fix

fix: CourseLimitedStaffRole should not be able to access studio.
(cherry picked from commit 5c1d31c)
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