MDL-55982 mod_forum: Add time-based discussion locking
[moodle.git] / mod / forum / db / access.php
CommitLineData
bbbf2d40 1<?php
8f685009 2// This file is part of Moodle - http://moodle.org/
bbbf2d40 3//
8f685009
SH
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.
bbbf2d40 8//
8f685009
SH
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.
bbbf2d40 13//
8f685009
SH
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/>.
bbbf2d40 16
8f685009 17/**
e67bc2a4 18 * Plugin capabilities
8f685009 19 *
e67bc2a4
PS
20 * @package mod_forum
21 * @copyright 2006 Martin Dougiamas
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
8f685009 23 */
bbbf2d40 24
e67bc2a4
PS
25defined('MOODLE_INTERNAL') || die();
26
0ac940b3 27$capabilities = array(
eef868d1 28
88eca3cd
TH
29 'mod/forum:addinstance' => array(
30 'riskbitmask' => RISK_XSS,
31
32 'captype' => 'write',
33 'contextlevel' => CONTEXT_COURSE,
34 'archetypes' => array(
35 'editingteacher' => CAP_ALLOW,
36 'manager' => CAP_ALLOW
37 ),
38 'clonepermissionsfrom' => 'moodle/course:manageactivities'
39 ),
40
bbbf2d40 41 'mod/forum:viewdiscussion' => array(
eef868d1 42
bbbf2d40 43 'captype' => 'read',
44 'contextlevel' => CONTEXT_MODULE,
31c93303 45 'archetypes' => array(
4f0c2d00 46 'frontpage' => CAP_ALLOW, // needed especially for news on the frontpage
00adf177 47 'guest' => CAP_ALLOW,
bbbf2d40 48 'student' => CAP_ALLOW,
49 'teacher' => CAP_ALLOW,
50 'editingteacher' => CAP_ALLOW,
4f0c2d00 51 'manager' => CAP_ALLOW
bbbf2d40 52 )
53 ),
eef868d1 54
f0eb2ffe 55 'mod/forum:viewhiddentimedposts' => array(
eef868d1 56
f0eb2ffe 57 'captype' => 'read',
58 'contextlevel' => CONTEXT_MODULE,
31c93303 59 'archetypes' => array(
f0eb2ffe 60 'teacher' => CAP_ALLOW,
61 'editingteacher' => CAP_ALLOW,
4f0c2d00 62 'manager' => CAP_ALLOW
f0eb2ffe 63 )
64 ),
eef868d1 65
bbbf2d40 66 'mod/forum:startdiscussion' => array(
eef868d1 67
21b6db6e 68 'riskbitmask' => RISK_SPAM,
69
70 'captype' => 'write',
bbbf2d40 71 'contextlevel' => CONTEXT_MODULE,
31c93303 72 'archetypes' => array(
bbbf2d40 73 'student' => CAP_ALLOW,
74 'teacher' => CAP_ALLOW,
75 'editingteacher' => CAP_ALLOW,
4f0c2d00 76 'manager' => CAP_ALLOW
bbbf2d40 77 )
78 ),
eef868d1 79
bbbf2d40 80 'mod/forum:replypost' => array(
eef868d1 81
21b6db6e 82 'riskbitmask' => RISK_SPAM,
83
84 'captype' => 'write',
bbbf2d40 85 'contextlevel' => CONTEXT_MODULE,
31c93303 86 'archetypes' => array(
bbbf2d40 87 'student' => CAP_ALLOW,
88 'teacher' => CAP_ALLOW,
89 'editingteacher' => CAP_ALLOW,
4f0c2d00 90 'manager' => CAP_ALLOW
bbbf2d40 91 )
92 ),
eef868d1 93
c718dd57 94 'mod/forum:addnews' => array(
95
96 'riskbitmask' => RISK_SPAM,
97
98 'captype' => 'write',
99 'contextlevel' => CONTEXT_MODULE,
31c93303 100 'archetypes' => array(
c718dd57 101 'teacher' => CAP_ALLOW,
102 'editingteacher' => CAP_ALLOW,
4f0c2d00 103 'manager' => CAP_ALLOW
c718dd57 104 )
105 ),
106
107 'mod/forum:replynews' => array(
108
109 'riskbitmask' => RISK_SPAM,
110
111 'captype' => 'write',
112 'contextlevel' => CONTEXT_MODULE,
31c93303 113 'archetypes' => array(
c718dd57 114 'teacher' => CAP_ALLOW,
115 'editingteacher' => CAP_ALLOW,
4f0c2d00 116 'manager' => CAP_ALLOW
c718dd57 117 )
118 ),
119
bbbf2d40 120 'mod/forum:viewrating' => array(
eef868d1 121
bbbf2d40 122 'captype' => 'read',
123 'contextlevel' => CONTEXT_MODULE,
31c93303 124 'archetypes' => array(
bbbf2d40 125 'student' => CAP_ALLOW,
126 'teacher' => CAP_ALLOW,
127 'editingteacher' => CAP_ALLOW,
4f0c2d00 128 'manager' => CAP_ALLOW
bbbf2d40 129 )
130 ),
eef868d1 131
bbbf2d40 132 'mod/forum:viewanyrating' => array(
eef868d1 133
6595a568 134 'riskbitmask' => RISK_PERSONAL,
bbbf2d40 135 'captype' => 'read',
136 'contextlevel' => CONTEXT_MODULE,
31c93303 137 'archetypes' => array(
bbbf2d40 138 'teacher' => CAP_ALLOW,
139 'editingteacher' => CAP_ALLOW,
4f0c2d00 140 'manager' => CAP_ALLOW
bbbf2d40 141 )
142 ),
eef868d1 143
6595a568
MD
144 'mod/forum:viewallratings' => array(
145
146 'riskbitmask' => RISK_PERSONAL,
147 'captype' => 'read',
148 'contextlevel' => CONTEXT_MODULE,
31c93303 149 'archetypes' => array(
6595a568
MD
150 'teacher' => CAP_ALLOW,
151 'editingteacher' => CAP_ALLOW,
152 'manager' => CAP_ALLOW
153 ),
154 'clonepermissionsfrom' => 'mod/forum:viewanyrating'
155 ),
156
bbbf2d40 157 'mod/forum:rate' => array(
eef868d1 158
21b6db6e 159 'captype' => 'write',
bbbf2d40 160 'contextlevel' => CONTEXT_MODULE,
31c93303 161 'archetypes' => array(
bbbf2d40 162 'teacher' => CAP_ALLOW,
163 'editingteacher' => CAP_ALLOW,
4f0c2d00 164 'manager' => CAP_ALLOW
bbbf2d40 165 )
166 ),
eef868d1 167
bbbf2d40 168 'mod/forum:createattachment' => array(
eef868d1 169
21b6db6e 170 'riskbitmask' => RISK_SPAM,
171
172 'captype' => 'write',
bbbf2d40 173 'contextlevel' => CONTEXT_MODULE,
31c93303 174 'archetypes' => array(
bbbf2d40 175 'student' => CAP_ALLOW,
176 'teacher' => CAP_ALLOW,
177 'editingteacher' => CAP_ALLOW,
4f0c2d00 178 'manager' => CAP_ALLOW
bbbf2d40 179 )
180 ),
eef868d1 181
bbbf2d40 182 'mod/forum:deleteownpost' => array(
eef868d1 183
bbbf2d40 184 'captype' => 'read',
185 'contextlevel' => CONTEXT_MODULE,
31c93303 186 'archetypes' => array(
bbbf2d40 187 'student' => CAP_ALLOW,
188 'teacher' => CAP_ALLOW,
189 'editingteacher' => CAP_ALLOW,
4f0c2d00 190 'manager' => CAP_ALLOW
bbbf2d40 191 )
192 ),
eef868d1 193
bbbf2d40 194 'mod/forum:deleteanypost' => array(
eef868d1 195
bbbf2d40 196 'captype' => 'read',
197 'contextlevel' => CONTEXT_MODULE,
31c93303 198 'archetypes' => array(
bbbf2d40 199 'teacher' => CAP_ALLOW,
200 'editingteacher' => CAP_ALLOW,
4f0c2d00 201 'manager' => CAP_ALLOW
bbbf2d40 202 )
203 ),
eef868d1 204
bbbf2d40 205 'mod/forum:splitdiscussions' => array(
eef868d1 206
bbbf2d40 207 'captype' => 'read',
208 'contextlevel' => CONTEXT_MODULE,
31c93303 209 'archetypes' => array(
bbbf2d40 210 'teacher' => CAP_ALLOW,
211 'editingteacher' => CAP_ALLOW,
4f0c2d00 212 'manager' => CAP_ALLOW
bbbf2d40 213 )
214 ),
eef868d1 215
bbbf2d40 216 'mod/forum:movediscussions' => array(
eef868d1 217
bbbf2d40 218 'captype' => 'read',
219 'contextlevel' => CONTEXT_MODULE,
31c93303 220 'archetypes' => array(
bbbf2d40 221 'teacher' => CAP_ALLOW,
222 'editingteacher' => CAP_ALLOW,
4f0c2d00 223 'manager' => CAP_ALLOW
bbbf2d40 224 )
225 ),
eef868d1 226
87b007b4
CF
227 'mod/forum:pindiscussions' => array(
228
5f219cf1 229 'captype' => 'write',
87b007b4
CF
230 'contextlevel' => CONTEXT_MODULE,
231 'archetypes' => array(
232 'teacher' => CAP_ALLOW,
233 'editingteacher' => CAP_ALLOW,
234 'manager' => CAP_ALLOW
235 )
236 ),
237
bbbf2d40 238 'mod/forum:editanypost' => array(
eef868d1 239
21b6db6e 240 'riskbitmask' => RISK_SPAM,
241
242 'captype' => 'write',
bbbf2d40 243 'contextlevel' => CONTEXT_MODULE,
31c93303 244 'archetypes' => array(
bbbf2d40 245 'teacher' => CAP_ALLOW,
246 'editingteacher' => CAP_ALLOW,
4f0c2d00 247 'manager' => CAP_ALLOW
bbbf2d40 248 )
249 ),
eef868d1 250
bbbf2d40 251 'mod/forum:viewqandawithoutposting' => array(
eef868d1 252
bbbf2d40 253 'captype' => 'read',
254 'contextlevel' => CONTEXT_MODULE,
31c93303 255 'archetypes' => array(
bbbf2d40 256 'teacher' => CAP_ALLOW,
257 'editingteacher' => CAP_ALLOW,
4f0c2d00 258 'manager' => CAP_ALLOW
bbbf2d40 259 )
260 ),
eef868d1 261
bbbf2d40 262 'mod/forum:viewsubscribers' => array(
eef868d1 263
bbbf2d40 264 'captype' => 'read',
265 'contextlevel' => CONTEXT_MODULE,
31c93303 266 'archetypes' => array(
bbbf2d40 267 'teacher' => CAP_ALLOW,
268 'editingteacher' => CAP_ALLOW,
4f0c2d00 269 'manager' => CAP_ALLOW
bbbf2d40 270 )
271 ),
eef868d1 272
bbbf2d40 273 'mod/forum:managesubscriptions' => array(
eef868d1 274
3a0c6cca 275 'riskbitmask' => RISK_SPAM,
276
bbbf2d40 277 'captype' => 'read',
278 'contextlevel' => CONTEXT_MODULE,
31c93303 279 'archetypes' => array(
bbbf2d40 280 'teacher' => CAP_ALLOW,
281 'editingteacher' => CAP_ALLOW,
4f0c2d00 282 'manager' => CAP_ALLOW
bbbf2d40 283 )
0fa18d5a 284 ),
eef868d1 285
d4514e46 286 'mod/forum:postwithoutthrottling' => array(
d43d749a 287
288 'riskbitmask' => RISK_SPAM,
eef868d1 289
0fa18d5a 290 'captype' => 'write',
291 'contextlevel' => CONTEXT_MODULE,
31c93303 292 'archetypes' => array(
d4514e46
AD
293 'teacher' => CAP_ALLOW,
294 'editingteacher' => CAP_ALLOW,
295 'manager' => CAP_ALLOW
0fa18d5a 296 )
f98b13a6 297 ),
298
299 'mod/forum:exportdiscussion' => array(
bbbf2d40 300
f98b13a6 301 'riskbitmask' => RISK_PERSONAL,
302
303 'captype' => 'read',
304 'contextlevel' => CONTEXT_MODULE,
31c93303 305 'archetypes' => array(
f98b13a6 306 'teacher' => CAP_ALLOW,
307 'editingteacher' => CAP_ALLOW,
4f0c2d00 308 'manager' => CAP_ALLOW
f98b13a6 309 )
310 ),
311 'mod/forum:exportpost' => array(
312
313 'riskbitmask' => RISK_PERSONAL,
314
315 'captype' => 'read',
316 'contextlevel' => CONTEXT_MODULE,
31c93303 317 'archetypes' => array(
f98b13a6 318 'teacher' => CAP_ALLOW,
319 'editingteacher' => CAP_ALLOW,
4f0c2d00 320 'manager' => CAP_ALLOW
f98b13a6 321 )
322 ),
323 'mod/forum:exportownpost' => array(
324
325 'riskbitmask' => RISK_PERSONAL,
326
327 'captype' => 'read',
328 'contextlevel' => CONTEXT_MODULE,
31c93303 329 'archetypes' => array(
f98b13a6 330 'teacher' => CAP_ALLOW,
331 'editingteacher' => CAP_ALLOW,
4f0c2d00 332 'manager' => CAP_ALLOW,
f98b13a6 333 'student' => CAP_ALLOW,
334 )
335 ),
db8312d2
RW
336 'mod/forum:addquestion' => array(
337
338 'riskbitmask' => RISK_SPAM,
339
340 'captype' => 'write',
341 'contextlevel' => CONTEXT_MODULE,
342 'archetypes' => array(
343 'teacher' => CAP_ALLOW,
344 'editingteacher' => CAP_ALLOW,
345 'manager' => CAP_ALLOW
346 )
347 ),
1659b1d1
RL
348 'mod/forum:allowforcesubscribe' => array(
349
350 'captype' => 'read',
351 'contextlevel' => CONTEXT_MODULE,
352 'archetypes' => array(
353 'student' => CAP_ALLOW,
354 'teacher' => CAP_ALLOW,
afd5e85c
RT
355 'editingteacher' => CAP_ALLOW,
356 'frontpage' => CAP_ALLOW
1659b1d1 357 )
e507b363 358 ),
2587313a
DC
359 'mod/forum:canposttomygroups' => array(
360
361 'captype' => 'write',
362 'contextlevel' => CONTEXT_MODULE,
363 'archetypes' => array(
364 'teacher' => CAP_ALLOW,
365 'editingteacher' => CAP_ALLOW,
366 'manager' => CAP_ALLOW
367 )
368 ),
0f3bbfd4
AN
369 'mod/forum:canoverridediscussionlock' => array(
370 'captype' => 'write',
371 'contextlevel' => CONTEXT_MODULE,
372 'archetypes' => array(
373 'teacher' => CAP_ALLOW,
374 'editingteacher' => CAP_ALLOW,
375 'manager' => CAP_ALLOW
376 )
377 ),
f98b13a6 378);
1adbd2c3 379