numbas / numbas-lti-provider

An LTI tool provider to run Numbas exams
https://docs.numbas.org.uk/lti/en/latest/
Other
11 stars 12 forks source link

Canvas Roles: override admin access when the user explicitly has a learner membership to the course #341

Closed Lycanic closed 1 week ago

Lycanic commented 1 month ago

When accessing tests in canvas, I have institutional roles of: 'http://purl.imsglobal.org/vocab/lis/v2/institution/person#Administrator', 'http://purl.imsglobal.org/vocab/lis/v2/institution/person#Instructor', 'http://purl.imsglobal.org/vocab/lis/v2/institution/person#Student', 'http://purl.imsglobal.org/vocab/lis/v2/system/person#User'

regardless of where I am accessing the test from (ie even in places where I am not an administrator and only have access as a student, not as instructor or administrator).

This results in some awkwardness both when testing and when staff are enrolled as students and expecting to take tests.

Canvas provides a 'http://purl.imsglobal.org/vocab/lis/v2/membership' role where a user explicitly has a membership on a course, which can cover '#Learner', '#Instructor', '/Instructor#TeachingAssistant' at least (whilst we didn't find others during testing, it seems likely that they do exist). It is possible to have multiple membership roles (eg both instructor and teaching assistant).

We should at minimin override a user's admin access when they are registered as 'http://purl.imsglobal.org/vocab/lis/v2/membership#Learner' and no other memberships on a course.

christianp commented 1 week ago

Done in https://github.com/christianp/pylti1.3/commit/6d375a8b50b4a9206ba38c65061ac8083a7d5f7b