Can not delete course. error: not authorized

Can not delete course. error: not authorized

by Ted Mackay -
Number of replies: 1

When I try to delete a course I get the error not authorized user. I am the admin but keep getting this:


You do not have the permission to delete this course

More information about this error

I attached the screen shot of the debug info.

Anny help would be appreciated.


Attachment screenshot-moodle.tedsautomech.ca-2021.01.10-12_45_19.png
Average of ratings: -
In reply to Ted Mackay

Re: Can not delete course. error: not authorized

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You don't mention which Moodle version, so that _might_ make a difference to answer.

However, a quick look at the code suggests this is something that really shouldn't be able to happen for a site admin, unless you are trying to delete the 'front page' course for the site (usually id=1). If you are logged in as the site administrator, then the capability check for being able to delete the course should automatically pass (indeed, as site admin, all capability checks are hard-coded to pass).