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

👍

  • I tested this: Limited staff do not get course access in studio
  • 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 36f199a into opencraft/teak Dec 16, 2025
47 checks passed
@Kelketek Kelketek deleted the viadanna/teak/course-limited-staff-fix branch December 16, 2025 21:31
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