Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roles mangled by Membership service due to hardcoded LTI version #52

Closed
chrispittman opened this issue Apr 3, 2023 · 2 comments
Closed

Comments

@chrispittman
Copy link

In two places in Service/Membership/getMembers(), Tool::parseRoles() is called, with a hardcoded LTI version of Util::LTI_VERSION2. This leads to a bug in LTI 1.3 tools, which can receive membership roles for a user such as this pair (for a user who is both a teacher and a TA in the same course):

  [ "http://purl.imsglobal.org/vocab/lis/v2/membership/Instructor#TeachingAssistant" , 
    "http://purl.imsglobal.org/vocab/lis/v2/membership#Instructor" ]

parseRoles() using LTI_VERSION2 incorrectly collapses these down into one role:

  http://purl.imsglobal.org/vocab/lis/v2/membership#TeachingAssistant

...which isn't even one of the roles that the LTI 1.3 spec allows, as far as I can tell.

Changing the hardcoded version in these calls to LTI_VERSION1P3 causes this pair of roles to be preserved correctly.

(Offhand, it looks like the Membership class has access to the platform's LTI version (through $this->source->getPlatform()->ltiVersion)...maybe it could use that instead of hardcoding LTI_VERSION2?)

@spvickers
Copy link
Contributor

Thanks for reporting this, I will take a closer look. On first glance the first call to parseRoles in Service/Membership looks correct as it relates to a JSON-LD response, but the second may be wrong.

@spvickers
Copy link
Contributor

Thanks again for reporting this,. You are quite correct, the LTI version passed to the parseRoles method should be the version to be used for the roles being returned. I have committed the change to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants