1EdTech / LTI-Tool-Provider-Library-PHP

Apache License 2.0
68 stars 74 forks source link

User hasRole does not correctly check LTI 2.x role descriptions #23

Open screambeard opened 7 years ago

screambeard commented 7 years ago

In the LTI 2.x guide of IMSGlobal the format of the roles can take a new form (as canvas provides). This are shown in the guide you can find here: guide.

For example, canvas provides the following roles:

urn:lti:role:ims/lis/http://purl.imsglobal.org/vocab/lis/v2/institution/person#Instructor urn:lti:role:ims/lis/http://purl.imsglobal.org/vocab/lis/v2/membership#Instructor urn:lti:role:ims/lis/http://purl.imsglobal.org/vocab/lis/v2/system/person#User

Which even seem to be a combination of the old and new standard.

Ideally the hasRole function checks for several possibilities. Not it only check for the old standard:

urn:lti:role:ims/lis/Learner urn:lti:role:ims/lis/Instructor etc.

I would suggest updating the package to take into account the new standard for roles as well. This should than be added in the User.php file: github link

screambeard commented 7 years ago

Any update on this? I'm willing to work on this and help resolve it.

gerysk commented 6 years ago

The parseRoles function in ToolProvider does not seem to take into consideration the LTI 2.x role format and creates this monstrosity of a role. Is there any update on this?