AnsweredAssumed Answered

Support completing code to hide a menu option in new Admin role

Question asked by Tim Batiuk on Aug 3, 2018
Latest reply on Aug 3, 2018 by bneporadny@southcollegetn.edu

Hi there,

 

I created a custom admin role enabling teachers to view all courses on the account (and no other functionality), but unfortunately this admin role defaults to also giving access to the Canvas Parent Tools LTI that is configured. This is not a permission that can be toggled under roles since it is LTI. I would like teachers to not have easy access to this, so hiding that content seems to be a good option to prevent easy access.

 

I followed the excellent guide at (https://community.canvaslms.com/people/james@richland.edu/blog/2017/06/14/hiding-content-from-certain-roles) but have yet to produce the desired results. Here is what I have written:

 

(function() {

if (document.URL.endsWith(‘1?’) && ENV.current_user_roles.indexOf('teacher’) > -1) {

    $('a[href$="/104"]').remove();

}

})();

 

And below is the code in question taken from that page (https://fca.instructure.com/accounts/1?):

code

 

ENV current user roles

 

Would anyone be willing to point me in the right direction of improving this code? I greatly appreciate it. Thank you!

Outcomes