Skip to content

Commit 355eab9

Browse files
committed
fix: block only students
1 parent 2dff9a4 commit 355eab9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tutoraspects/templates/aspects/apps/superset/pythonpath/openedx_sso_security_manager.py

+5
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ def get_courses(self, username, permission="staff", next_url=None):
153153
for course_id in next_courses:
154154
courses.append(course_id)
155155

156+
# If the user has staff access to any courses, they are an instructor
157+
if courses:
158+
return courses
159+
160+
# If the user has no staff access to any courses, they are a student
156161
if bool("{{SUPERSET_BLOCK_STUDENT_ACCESS}}"):
157162
raise Exception(f"User {username} is not an instructor")
158163
else:

0 commit comments

Comments
 (0)