CSS or JavaScript Code to Disable Instructor Ability to Change Course Image

Jump to solution
casey_eubank
Community Explorer

We want to remove the ability for instructors to edit and change the course image.  Does anyone have any code (CSS or JavaScript) that would do this?

Thank you in advance for any assistance you can provide.

0 Likes
1 Solution

Hi @casey_eubank,

Try this:

if ((/^\/courses\/[0-9]+\/settings$/.test(window.location.pathname)) && (!ENV.current_user_roles.includes('root_admin'))) {
    let courseImageChangeButtons=document.querySelectorAll('.CourseImageSelector__Button, .CourseImageSelector > button');
    for (let i = 0; i < courseImageChangeButtons.length; i++)
        courseImageChangeButtons[i].style.display='none';
}

 

-Chris

View solution in original post