cancel
Showing results for 
Search instead for 
Did you mean: 
delester
Community Member

Remove "delete course" permission from teacher

Jump to solution

I am the Canvas admin at my institution. I have had two recent incidents where teachers abruptly deleted their courses from Canvas. How do I remove the "delete course" permission from the teacher role?

1 Solution

Accepted Solutions
delester
Community Member

I'm no good at javascript, but pretty good with CSS. Here's how I solved it in our CSS overrides file:

/* hide the "Permanently Delete this Course" button to prevent teachers from deleting courses */

#right-side a:nth-of-type(5n).delete_course_link {

  display:none;

  }

Thanks to those who helped.

View solution in original post

15 Replies
Robbie_Grant
Community Coach
Community Coach

 @delester ​,

You can use javascript to remove that button from the Teacher view.  This can be done using the Custom Java Script area in the Admin interface.


Robbie

But be advised that there are ways to get around that if they try hard enough.

kona
Community Coach
Community Coach

Yes, but in the 2+ years using it none of the faculty at my Institution have gotten around it! Smiley Wink

delester
Community Member

I'm no good at javascript, but pretty good with CSS. Here's how I solved it in our CSS overrides file:

/* hide the "Permanently Delete this Course" button to prevent teachers from deleting courses */

#right-side a:nth-of-type(5n).delete_course_link {

  display:none;

  }

Thanks to those who helped.

View solution in original post

Check out the "Branding" >> "JavaScript" folder here: kajigga/canvas-contrib · GitHub.  Lots of "tweaks" you can do in JavaScript.

If you want to use JS and set it so that admins can view, you can use:

$(document).ready(function(){

if($.inArray('admin',ENV['current_user_roles']) == -1) {

    $("a.btn.button-sidebar-wide.delete_course_link").hide();

}

})

This will get you started and allow you to hide other functions from teachers, TA's, etc. Using CSS is good, but it will also take it from you as the admin.

Shane

Thanks, Shane, that's very helpful. Yes CSS takes it away from me as an admin, but it is easy to comment out temporarily if I need to delete a course. Still, I'm going to try your JS solution.

Why have to use JavaScript to remove an option that would seem to be a permissions choice?  I can stop an instructor from changing their course name via the GUI, but I can't prevent them from deleting their course.  Does "Permanently Delete" mean permanently delete, or can it be restored by the Admin?  Or, if we have automated SIS Imports scripts running, would they just re-enable the course, if it is still in the script?

If I have to do this with JavaScript, will future Canvas upgrades incorporate this modification, or would I need to put this in a list to keep checking that it is still working?

 @bgibson ​, just a few minutes ago, cms_hickss posted this convenient compilation of feature ideas that are currently open for voting, all of which pertain to "More Granular Permissions" : more granular permissions (Idea voting closing soon)

Please vote!