## Roles and permissions

### Course creators and deleting courses

This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.
Course creators and deleting courses

We've assigned course creators within categories and would like them to be able to delete courses within their categories as well. I've tried modifying the role to add 'delete courses' both within the category and in the global permissions, but there doesn't seem to be an option available to the course creator to delete a course.

How would they delete courses? Am I missing something obvious?

Thanks,
Julie

Average of ratings: -
Re: Course creators and deleting courses
Hi Julie,

As far as I know, course creators can delete courses, though there is no GUI for them to do so. A workaround is to edit a course for deletion's URL i.e. change http://yourmoodlesite.org/course/view.php?id=4 in your browser's address bar to http://yourmoodlesite.org/course/delete.php?id=4.

Average of ratings: Useful (2)
Re: Course creators and deleting courses

Thanks Helen!

Average of ratings: -
Re: Course creators and deleting courses
Just been trying this out. It seems that the person assigned as course creator e.g. globally, must also be assigned as a teacher in the course to be deleted (phew!).

Average of ratings: Useful (1)
Re: Course creators and deleting courses

To create a simple GUI for course creators to delete a course, you may want to try this. It creates a "delete this course" link in the administration block of the course:

In the file block_admin.php under moodle/blocks/admin, add these few lines towards the end of the file (just before the line: "/// Should the following two be in this block?"):

if (has_capability('moodle/course:create', $context) and has_capability('moodle/course:manageactivities',$context)) {
$this->content->items[]='<a href="'.$CFG->wwwroot.'/course/delete.php?id='.$course->id.'">'."delete this course".'</a>';$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/cross_red_big.gif" class="icon" alt="" />'; } Average of ratings: - Re: Course creators and deleting courses Maybe better is "if has_capability('moodle/course:delete',$context)" (not "if (has_capability('moodle/course:create', $context) and has_capability('moodle/course:manageactivities',$context))" ).
And then you can as admin better manage it under Administration > Users > Permissions > Define Roles .. radio button course delete.

Warm greetings.

Average of ratings: -