AnsweredAssumed Answered

Detect TA role on landing page

Question asked by Canvas Support Admin USFCA on Dec 12, 2016
Latest reply on Dec 13, 2016 by Danny Wahl



I have an LTI integration (Blue Explorance Teaching Surveys).



if(ENV.current_user_roles.indexOf('teacher') >= 0) { //items to show to teachers and admins addMenuItem('Teaching
Surveys', 'https://<ourschool>', 'icon-peer-review', '_blank'); } else if (ENV.current_user_roles.indexOf('admin') >= 0) { //items to show to teachers and admins addMenuItem('Teaching
Surveys', 'https://<ourschool>', 'icon-peer-review', '_blank'); }


-Note I use an arbitrary UID, but it would be better form to build it from the current user context, so I will work to improve that aspect, but it would not change that the role being detected for TA is teacher. I had found a reference which seems to suggest this effect.


-My question is does anyone know how to select for teachers, students, and (if TAs are rolling up to teacher role), TAs so that I can direct them to the appropriate LTI?


I have separately submitted this as a support case to both Instructure and Blue, but it's custom JS and may not fall within those spaces. I post it here believing I cannot be the only one who has faced the need to separate TAs from teachers (as they are more likely to need student fronted features, than teacher.


[For reference, this is the link to the discussion from which I make the assumptions about TAs being teacher role members as per current_user_roles:Account Role Detection


The link mentions the Enrollment object but I am uncertain if the scope of that object extends to the main landing page, as TaEnrollment, TeacherEnrollment, seem more likely to resolve on course pages.


As a workaround for my issue, I've used the generic link out to the vendor website, but the user would like the integrated portal to work as described (TAs being sent to the student version of the LIT).