Skip to content

Commit

Permalink
Merge pull request #381 from ccnmtl/ta-auth
Browse files Browse the repository at this point in the history
Adds context if TA is authorized as faculty
  • Loading branch information
sdreher authored Sep 29, 2021
2 parents 6e9de35 + 5fc5a74 commit cb48f3e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lti_provider/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,17 @@ def get_context_data(self, **kwargs):
domain = self.request.get_host()
url = settings.LTI_TOOL_CONFIGURATION['landing_url'].format(
self.request.scheme, domain, self.lti.course_context(self.request))
is_auth_ta = None
if settings.LTI_TOOL_CONFIGURATION['allow_ta_access']:
role = self.request.session.get('roles', '').lower()
is_auth_ta = 'teachingassistant' in role

return {
'landing_url': url,
'title': settings.LTI_TOOL_CONFIGURATION.get('title'),
'is_instructor': self.lti.is_instructor(self.request),
'is_administrator': self.lti.is_administrator(self.request),
'is_auth_ta': is_auth_ta
}


Expand Down

0 comments on commit cb48f3e

Please sign in to comment.