What are Moodle context levels?

If you’re programming with Moodle, you probably want to stick with the APIs, but if you’re trying to track things down through the database, knowing what context levels mean can be important. Until my colleague from CLICC found this, all I know was that 50 meant course.

Defined, at least in Moodle 1.7, in /moodle/lib/accesslib.php

// context definitions
define('CONTEXT_SYSTEM', 10);
define('CONTEXT_PERSONAL', 20);
define('CONTEXT_USER', 30);
define('CONTEXT_COURSECAT', 40);
define('CONTEXT_COURSE', 50);
define('CONTEXT_GROUP', 60);
define('CONTEXT_MODULE', 70);
define('CONTEXT_BLOCK', 80);