Javascript to hide role in +people if FERPA training not completed

Jump to solution
patfm
Community Explorer

We are trying to see if there is a way using JavaScript to prevent Teachers from adding TAs and Graders to a course unless they have gone through FERPA training.  Our Registrar keeps a database table listing all staff, students who have completed FERPA training and we were thinking of adding an attribute to Canvas USERS either using an unused field like BIO or a custom field to hold that data -'Y' if FERPA trained -- using an existing SIS  batch job that is run 3 times a day.  We are wondering about the feasibility of using JavaScript to check that field and only show the GRADER or TA role in the dropdown of the +People tool if the student selected has the FERPA flag set to 'Y'.  We would love to hear from anyone with ideas for implementing this.people_tool.jpg

Labels (1)
0 Likes
1 Solution
chriscas
Community Coach
Community Coach

Hi @patfm,

First off, just wanted to let you know I'm going to move this post over to the developers area of the community, where you might get some better eyes on the tech side of things.  Hopefully you don't mind.

Onto the actual question you posed...  My initial reaction to this would be to perhaps suggest creating a different/custom role for teachers that have passed your FERPA training vs those that have not.  You could let theFERPA role add people in the TA category, and deny that for the non-FERPA role.  Looking at your screenshot, this seems like a possibility, but it would depend on whether you'd want to deny adding the undergrad ta too.  If it's okay to deny adding people with that role too, I'd highly recommend this route as it would be the most secure, and not rely on any JavaScript.  This does assume that you can customize your SIS batch job, which I think is likely based on your description.

I'll wait to see your response to the above before going into what I think the caveats of the JavaScript approach would be. as it might become a time consuming and lengthy post.

-Chris

View solution in original post