AnsweredAssumed Answered

Hide a link from student only

Question asked by HJ L on Feb 14, 2018
Latest reply on Feb 20, 2018 by scottd@instructure.com

I am trying to hide a link from students by using JS. So far, I have been trying the following codes; it seems to work when viewing as a student under the setting; nevertheless, it hides the link when viewing as an instructor, teacher, and admin, who are supposed to see the link. Any suggestions would be great!

 

if($.inArray('student', ENV['current_user_roles']) === 1 ) {
    $('a.link').hide();
}
else {
    $('a.link').show();
}

Outcomes