2 // This file is part of Moodle - http://moodle.org/
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
18 * Capability definitions for the lesson module.
20 * For naming conventions, see lib/db/access.php.
23 * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
24 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or late
27 defined('MOODLE_INTERNAL') || die();
29 $capabilities = array(
31 'mod/lesson:addinstance' => array(
32 'riskbitmask' => RISK_XSS,
35 'contextlevel' => CONTEXT_COURSE,
36 'archetypes' => array(
37 'editingteacher' => CAP_ALLOW,
38 'manager' => CAP_ALLOW
40 'clonepermissionsfrom' => 'moodle/course:manageactivities'
43 'mod/lesson:edit' => array(
45 'riskbitmask' => RISK_XSS, // we want flash and JS in question pages
48 'contextlevel' => CONTEXT_MODULE,
49 'archetypes' => array(
50 'editingteacher' => CAP_ALLOW,
51 'manager' => CAP_ALLOW
55 // Grade essay questions.
56 'mod/lesson:grade' => array(
57 'riskbitmask' => RISK_SPAM | RISK_XSS,
59 'contextlevel' => CONTEXT_MODULE,
60 'archetypes' => array(
61 'teacher' => CAP_ALLOW,
62 'editingteacher' => CAP_ALLOW,
63 'manager' => CAP_ALLOW
67 // View the lesson reports.
68 'mod/lesson:viewreports' => array(
69 'riskbitmask' => RISK_PERSONAL,
71 'contextlevel' => CONTEXT_MODULE,
72 'archetypes' => array(
73 'teacher' => CAP_ALLOW,
74 'editingteacher' => CAP_ALLOW,
75 'manager' => CAP_ALLOW
79 'mod/lesson:manage' => array(
82 'contextlevel' => CONTEXT_MODULE,
83 'archetypes' => array(
84 'teacher' => CAP_ALLOW,
85 'editingteacher' => CAP_ALLOW,
86 'manager' => CAP_ALLOW
90 // Edit the lesson overrides.
91 'mod/lesson:manageoverrides' => array(
93 'contextlevel' => CONTEXT_MODULE,
94 'archetypes' => array(
95 'editingteacher' => CAP_ALLOW,
96 'manager' => CAP_ALLOW
100 'mod/lesson:view' => array(
102 'contextlevel' => CONTEXT_MODULE,
103 'archetypes' => array(