Skip to content

Commit f14c6ee

Browse files
committed
fix: allow to configure when to block students
1 parent 3b83efd commit f14c6ee

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

tutoraspects/plugin.py

+1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@
186186
},
187187
),
188188
("SUPERSET_EXTRA_JINJA_FILTERS", {}),
189+
("SUPERSET_BLOCK_STUDENT_ACCESS", True),
189190
######################
190191
# dbt Settings
191192
# For the most part you shouldn't have to touch these

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,11 @@ def get_courses(self, username, permission="staff", next_url=None):
142142
for course_id in next_courses:
143143
courses.append(course_id)
144144

145-
raise Exception(f"User {username} is not an instructor")
145+
if bool("{{SUPERSET_BLOCK_STUDENT_ACCESS}}"):
146+
raise Exception(f"User {username} is not an instructor")
147+
else:
148+
return courses
149+
146150

147151

148152
UserAccess = namedtuple("UserAccess", ["username", "is_superuser", "is_staff"])

0 commit comments

Comments
 (0)