From 85a6c7704bbe979b42d9c92b5f01438c85b800b0 Mon Sep 17 00:00:00 2001 From: Ahmad Date: Fri, 17 Jan 2014 22:06:30 +0200 Subject: [PATCH] fixing roles parameter in launch data --- common/lib/xmodule/xmodule/lti_module.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/common/lib/xmodule/xmodule/lti_module.py b/common/lib/xmodule/xmodule/lti_module.py index 5257fd1247da..ed3a52dc816a 100644 --- a/common/lib/xmodule/xmodule/lti_module.py +++ b/common/lib/xmodule/xmodule/lti_module.py @@ -108,7 +108,7 @@ class LTIModule(LTIFields, XModule): 1. Get credentials from course settings. - 2. There is minimal set of parameters need to be signed (presented for Vitalsource):: + 2. There is minimal set of parameters or "basic launch data" need to be signed (presented for Vitalsource):: user_id oauth_callback @@ -117,12 +117,15 @@ class LTIModule(LTIFields, XModule): launch_presentation_return_url lti_message_type lti_version - role + roles *+ all custom parameters* These parameters should be encoded and signed by *OAuth1* together with `launch_url` and *POST* request type. + for a reference to all standard "basic launch data" see + http://www.imsglobal.org/LTI/v1p1p1/ltiIMGv1p1p1.html#_Toc330273026 + 3. Signing proceeds with client key/secret pair obtained from course settings. That pair should be obtained from LTI provider and set into course settings by course author. After that signature and other OAuth data are generated. @@ -162,7 +165,7 @@ class LTIModule(LTIFields, XModule): - + @@ -351,7 +354,11 @@ def oauth_params(self, custom_parameters, client_key, client_secret): u'launch_presentation_return_url': '', u'lti_message_type': u'basic-lti-launch-request', u'lti_version': 'LTI-1p0', - u'role': u'student', + + # TODO: do a check to see if the user is a course staff or a TA and so on + # in case use u'roles': u'Instructor' which give more privileges inside the + # Tool Provider side + u'roles': u'Student', # Parameters required for grading: u'resource_link_id': self.get_resource_link_id(),