Closed wade-tattersall closed 3 years ago
I think the most straightforward way to solve this is to have an INSTRUCTOR_ROLES
array in settings.py
, maybe with a default of ['Instructor','urn:lti:role:ims/lis/Instructor']
. Then if your VLE is sending something different, you can add it to that list without modifying the code.
The relevant part of the LTI spec is Appendix A, which lists fully qualified names for different roles.
GitHub auto-closed this. @wade-tattersall, I'd appreciate if you could update your instance and confirm it works with fully-qualified role names. I also updated the django-auth-lti package, which is installed from GitHub. You might need to remove it and rerun pip install -r requirements.txt
- I don't fully understand how pip decides to reinstall packages from git!
@wade-tattersall have you had a chance to check this?
I'm closing this because I think it works.
In
numbas_lti/views/mixins.py
, therequest_is_instructor
method checksreturn 'Instructor' in request.LTI.get('roles')
, and theMustBeInstructorMixin
defines the only allowed role as"Instructor"
too.However, the LTI standard says that the role, when fully qualified, should be
urn:lti:role:ims/lis/Instructor
, but that the default namespace is the ims namespace so just 'Instructor' is enough. However, Blackboard Learn includes the fully-qualified role, which means that currently numbas-lti is only usable if the instructor has a superuser account on the numbas-lti server.I think the arguably best solution would be for the django.lti-auth package to fully qualify all roles when it constructs them, and then you can test against those. However, an alternative would be for the numbas package to set
allowed_roles = ["Instructor", "urn:lti:role:ims/lis/Instructor"]
andreturn ("Instructor" in request.LTI.get('roles')) or ("urn:lti:role:ims/lis/Instructor" in request.LTI.get('roles'))
on the relevant lines innumbas_lti/views/mixins.py
. I've done this, and it seems to work so far.More generally, there are a lot of roles that might be acceptable, such as
urn:lti:role:ims/lis/ContentDeveloper
, so perhaps including that as a setting might be worthwhile. Some LMSs might have options to configure this on their end, but Blackboard is not one of them.