Skip to content
Snippets Groups Projects
Commit ade23852 authored by Bermudez, Jaime's avatar Bermudez, Jaime
Browse files

Add a check for a custom role key - specified via an optional project...

Add a check for a custom role key - specified via an optional project parameter - and merge into the existing list of roles if present.
parent b1742d26
No related branches found
No related tags found
No related merge requests found
from django.contrib import auth
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.core.exceptions import ImproperlyConfigured
from django.conf import settings
from timer import Timer
......@@ -92,6 +93,9 @@ class LTIAuthMiddleware(object):
'custom_canvas_user_login_id': request.POST.get('custom_canvas_user_login_id', None),
'roles': request.POST.get('roles', '').split(','),
}
# If a custom role key is defined in project, merge into existing role list
if getattr(settings, 'LTI_CUSTOM_ROLE_KEY', None):
lti_launch['roles'] += request.POST.get(settings.LTI_CUSTOM_ROLE_KEY, '').split(',')
request.session['LTI_LAUNCH'] = lti_launch
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment