MDL-22773 Database module export: include internal fields
[moodle.git] / mod / data / db / access.php
blob7c5a599e48f1d74790230a86c28e95f26edfdd63
1 <?php
2 // This file is part of Moodle - http://moodle.org/
3 //
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.
8 //
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/>.
17 /**
18 * Plugin capabilities
20 * @package mod_data
21 * @copyright 2006 Martin Dougiamas
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25 defined('MOODLE_INTERNAL') || die();
27 $capabilities = array(
29 'mod/data:addinstance' => array(
30 'riskbitmask' => RISK_XSS,
32 'captype' => 'write',
33 'contextlevel' => CONTEXT_COURSE,
34 'archetypes' => array(
35 'editingteacher' => CAP_ALLOW,
36 'manager' => CAP_ALLOW
38 'clonepermissionsfrom' => 'moodle/course:manageactivities'
41 'mod/data:viewentry' => array(
43 'captype' => 'read',
44 'contextlevel' => CONTEXT_MODULE,
45 'archetypes' => array(
46 'frontpage' => CAP_ALLOW, // needed for databases on the frontpage
47 'guest' => CAP_ALLOW,
48 'student' => CAP_ALLOW,
49 'teacher' => CAP_ALLOW,
50 'editingteacher' => CAP_ALLOW,
51 'manager' => CAP_ALLOW
55 'mod/data:writeentry' => array(
57 'riskbitmask' => RISK_SPAM,
59 'captype' => 'write',
60 'contextlevel' => CONTEXT_MODULE,
61 'archetypes' => array(
62 'student' => CAP_ALLOW,
63 'teacher' => CAP_ALLOW,
64 'editingteacher' => CAP_ALLOW,
65 'manager' => CAP_ALLOW
69 'mod/data:comment' => array(
71 'riskbitmask' => RISK_SPAM,
73 'captype' => 'write',
74 'contextlevel' => CONTEXT_MODULE,
75 'archetypes' => array(
76 'student' => CAP_ALLOW,
77 'teacher' => CAP_ALLOW,
78 'editingteacher' => CAP_ALLOW,
79 'manager' => CAP_ALLOW
83 'mod/data:rate' => array(
85 'captype' => 'write',
86 'contextlevel' => CONTEXT_MODULE,
87 'archetypes' => array(
88 'teacher' => CAP_ALLOW,
89 'editingteacher' => CAP_ALLOW,
90 'manager' => CAP_ALLOW
94 'mod/data:viewrating' => array(
96 'captype' => 'read',
97 'contextlevel' => CONTEXT_MODULE,
98 'archetypes' => array(
99 'teacher' => CAP_ALLOW,
100 'editingteacher' => CAP_ALLOW,
101 'manager' => CAP_ALLOW
105 'mod/data:viewanyrating' => array(
107 'riskbitmask' => RISK_PERSONAL,
108 'captype' => 'read',
109 'contextlevel' => CONTEXT_MODULE,
110 'archetypes' => array(
111 'teacher' => CAP_ALLOW,
112 'editingteacher' => CAP_ALLOW,
113 'manager' => CAP_ALLOW
115 'clonepermissionsfrom' => 'mod/data:viewrating'
118 'mod/data:viewallratings' => array(
120 'riskbitmask' => RISK_PERSONAL,
121 'captype' => 'read',
122 'contextlevel' => CONTEXT_MODULE,
123 'archetypes' => array(
124 'teacher' => CAP_ALLOW,
125 'editingteacher' => CAP_ALLOW,
126 'manager' => CAP_ALLOW
128 'clonepermissionsfrom' => 'mod/data:viewrating'
131 'mod/data:approve' => array(
133 'riskbitmask' => RISK_SPAM,
135 'captype' => 'write',
136 'contextlevel' => CONTEXT_MODULE,
137 'archetypes' => array(
138 'teacher' => CAP_ALLOW,
139 'editingteacher' => CAP_ALLOW,
140 'manager' => CAP_ALLOW
144 'mod/data:manageentries' => array(
146 'riskbitmask' => RISK_SPAM,
148 'captype' => 'write',
149 'contextlevel' => CONTEXT_MODULE,
150 'archetypes' => array(
151 'teacher' => CAP_ALLOW,
152 'editingteacher' => CAP_ALLOW,
153 'manager' => CAP_ALLOW
157 'mod/data:managecomments' => array(
159 'riskbitmask' => RISK_SPAM,
161 'captype' => 'write',
162 'contextlevel' => CONTEXT_MODULE,
163 'archetypes' => array(
164 'teacher' => CAP_ALLOW,
165 'editingteacher' => CAP_ALLOW,
166 'manager' => CAP_ALLOW
170 'mod/data:managetemplates' => array(
172 'riskbitmask' => RISK_SPAM | RISK_XSS,
174 'captype' => 'write',
175 'contextlevel' => CONTEXT_MODULE,
176 'archetypes' => array(
177 'editingteacher' => CAP_ALLOW,
178 'manager' => CAP_ALLOW
182 'mod/data:viewalluserpresets' => array(
184 'captype' => 'read',
185 'contextlevel' => CONTEXT_MODULE,
186 'archetypes' => array(
187 'teacher' => CAP_ALLOW,
188 'editingteacher' => CAP_ALLOW,
189 'manager' => CAP_ALLOW
193 'mod/data:manageuserpresets' => array(
195 'riskbitmask' => RISK_SPAM | RISK_XSS,
197 'captype' => 'write',
198 'contextlevel' => CONTEXT_MODULE,
199 'archetypes' => array(
200 'manager' => CAP_ALLOW
204 'mod/data:exportentry' => array(
206 'riskbitmask' => RISK_PERSONAL,
208 'captype' => 'read',
209 'contextlevel' => CONTEXT_MODULE,
210 'archetypes' => array(
211 'manager' => CAP_ALLOW,
212 'teacher' => CAP_ALLOW,
213 'editingteacher' => CAP_ALLOW,
217 'mod/data:exportownentry' => array(
219 'captype' => 'read',
220 'contextlevel' => CONTEXT_MODULE,
221 'archetypes' => array(
222 'manager' => CAP_ALLOW,
223 'teacher' => CAP_ALLOW,
224 'editingteacher' => CAP_ALLOW,
225 'student' => CAP_ALLOW,
229 'mod/data:exportallentries' => array(
231 'riskbitmask' => RISK_PERSONAL,
233 'captype' => 'read',
234 'contextlevel' => CONTEXT_MODULE,
235 'archetypes' => array(
236 'manager' => CAP_ALLOW,
237 'teacher' => CAP_ALLOW,
238 'editingteacher' => CAP_ALLOW,
242 'mod/data:exportuserinfo' => array(
244 'riskbitmask' => RISK_PERSONAL,
246 'captype' => 'read',
247 'contextlevel' => CONTEXT_MODULE,
248 'archetypes' => array(
249 'manager' => CAP_ALLOW,
250 'teacher' => CAP_ALLOW,
251 'editingteacher' => CAP_ALLOW,