improved docs and license headers, adding direct access protection
[moodle.git] / lib / db / access.php
CommitLineData
117bd748 1<?php
5b4a78e2
PS
2
3// This file is part of Moodle - http://moodle.org/
bbbf2d40 4//
5b4a78e2
PS
5// Moodle is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
bbbf2d40 9//
5b4a78e2
PS
10// Moodle is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
bbbf2d40 14//
5b4a78e2
PS
15// You should have received a copy of the GNU General Public License
16// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
17
18/**
19 * Capability definitions for Moodle core.
20 *
21 * The capabilities are loaded into the database table when the module is
22 * installed or updated. Whenever the capability definitions are updated,
23 * the module version number should be bumped up.
24 *
25 * The system has four possible values for a capability:
26 * CAP_ALLOW, CAP_PREVENT, CAP_PROHIBIT, and inherit (not set).
27 *
28 *
29 * CAPABILITY NAMING CONVENTION
30 *
31 * It is important that capability names are unique. The naming convention
32 * for capabilities that are specific to modules and blocks is as follows:
33 * [mod/block]/<plugin_name>:<capabilityname>
34 *
35 * component_name should be the same as the directory name of the mod or block.
36 *
37 * Core moodle capabilities are defined thus:
38 * moodle/<capabilityclass>:<capabilityname>
39 *
40 * Examples: mod/forum:viewpost
41 * block/recent_activity:view
42 * moodle/site:deleteuser
43 *
44 * The variable name for the capability definitions array is $capabilities
45 *
46 * @package core
47 * @subpackage role
48 * @copyright 2006 onwards Martin Dougiamas http://dougiamas.com
49 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
50 */
bbbf2d40 51
5b4a78e2 52defined('MOODLE_INTERNAL') || die();
bbbf2d40 53
0ac940b3 54$capabilities = array(
bbbf2d40 55 'moodle/site:config' => array(
eef868d1 56
f432bebf 57 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG | RISK_DATALOSS,
21b6db6e 58
bbbf2d40 59 'captype' => 'write',
60 'contextlevel' => CONTEXT_SYSTEM,
31c93303 61 'archetypes' => array(
bbbf2d40 62 )
63 ),
eef868d1 64
51792df0 65 'moodle/site:readallmessages' => array(
eef868d1 66
bcdb0f19 67 'riskbitmask' => RISK_PERSONAL,
68
51792df0 69 'captype' => 'read',
70 'contextlevel' => CONTEXT_SYSTEM,
31c93303 71 'archetypes' => array(
4f0c2d00 72 'manager' => CAP_ALLOW,
4b7ae3c4 73 'editingteacher' => CAP_ALLOW
51792df0 74 )
75 ),
f7c0d84b 76
576ad290 77 'moodle/site:sendmessage' => array(
78
3a0c6cca 79 'riskbitmask' => RISK_SPAM,
576ad290 80
81 'captype' => 'write',
82 'contextlevel' => CONTEXT_SYSTEM,
31c93303 83 'archetypes' => array(
4f0c2d00 84 'manager' => CAP_ALLOW,
576ad290 85 'user' => CAP_ALLOW
86 )
f7c0d84b 87 ),
eef868d1 88
51792df0 89 'moodle/site:approvecourse' => array(
eef868d1 90
bcdb0f19 91 'riskbitmask' => RISK_XSS,
92
51792df0 93 'captype' => 'write',
94 'contextlevel' => CONTEXT_SYSTEM,
31c93303 95 'archetypes' => array(
4f0c2d00 96 'manager' => CAP_ALLOW
51792df0 97 )
98 ),
eef868d1 99
d2940003 100 'moodle/backup:backupcourse' => array(
eef868d1 101
21b6db6e 102 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
103
bbbf2d40 104 'captype' => 'write',
f432bebf 105 'contextlevel' => CONTEXT_COURSE,
31c93303 106 'archetypes' => array(
7246585a 107 'editingteacher' => CAP_ALLOW,
4f0c2d00 108 'manager' => CAP_ALLOW
d2940003
EL
109 ),
110
111 'clonepermissionsfrom' => 'moodle/site:backup'
bbbf2d40 112 ),
eef868d1 113
57ca97b3
EL
114 'moodle/backup:backupsection' => array(
115
116 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
117
118 'captype' => 'write',
119 'contextlevel' => CONTEXT_COURSE,
31c93303 120 'archetypes' => array(
57ca97b3
EL
121 'editingteacher' => CAP_ALLOW,
122 'manager' => CAP_ALLOW
123 ),
124
125 'clonepermissionsfrom' => 'moodle/backup:backupcourse'
126 ),
127
128 'moodle/backup:backupactivity' => array(
129
130 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
131
132 'captype' => 'write',
133 'contextlevel' => CONTEXT_MODULE,
31c93303 134 'archetypes' => array(
57ca97b3
EL
135 'editingteacher' => CAP_ALLOW,
136 'manager' => CAP_ALLOW
137 ),
138
139 'clonepermissionsfrom' => 'moodle/backup:backupcourse'
140 ),
141
142 'moodle/backup:backuptargethub' => array(
143
144 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
145
146 'captype' => 'write',
147 'contextlevel' => CONTEXT_COURSE,
31c93303 148 'archetypes' => array(
57ca97b3
EL
149 'editingteacher' => CAP_ALLOW,
150 'manager' => CAP_ALLOW
151 ),
152
153 'clonepermissionsfrom' => 'moodle/backup:backupcourse'
154 ),
155
156 'moodle/backup:backuptargetimport' => array(
157
158 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
159
160 'captype' => 'write',
161 'contextlevel' => CONTEXT_COURSE,
31c93303 162 'archetypes' => array(
57ca97b3
EL
163 'editingteacher' => CAP_ALLOW,
164 'manager' => CAP_ALLOW
165 ),
166
167 'clonepermissionsfrom' => 'moodle/backup:backupcourse'
168 ),
169
2fdde5d1 170 'moodle/backup:downloadfile' => array(
172dd12c 171
172 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
173
174 'captype' => 'write',
175 'contextlevel' => CONTEXT_COURSE,
31c93303 176 'archetypes' => array(
172dd12c 177 'editingteacher' => CAP_ALLOW,
4f0c2d00 178 'manager' => CAP_ALLOW
172dd12c 179 ),
180
2fdde5d1 181 'clonepermissionsfrom' => 'moodle/site:backupdownload'
172dd12c 182 ),
183
57ca97b3
EL
184 'moodle/backup:configure' => array(
185
186 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
187
188 'captype' => 'write',
189 'contextlevel' => CONTEXT_COURSE,
31c93303 190 'archetypes' => array(
57ca97b3
EL
191 'editingteacher' => CAP_ALLOW,
192 'manager' => CAP_ALLOW
193 )
194 ),
195
2fdde5d1 196 'moodle/backup:userinfo' => array(
172dd12c 197
2fdde5d1 198 'riskbitmask' => RISK_PERSONAL,
172dd12c 199
2fdde5d1 200 'captype' => 'read',
172dd12c 201 'contextlevel' => CONTEXT_COURSE,
31c93303 202 'archetypes' => array(
4f0c2d00 203 'manager' => CAP_ALLOW
2fdde5d1 204 )
172dd12c 205 ),
206
57ca97b3
EL
207 'moodle/backup:anonymise' => array(
208
209 'riskbitmask' => RISK_PERSONAL,
210
211 'captype' => 'read',
212 'contextlevel' => CONTEXT_COURSE,
31c93303 213 'archetypes' => array(
57ca97b3
EL
214 'manager' => CAP_ALLOW
215 )
216 ),
217
2fdde5d1 218 'moodle/restore:restorecourse' => array(
f2a0da6c 219
2fdde5d1 220 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
f2a0da6c 221
2fdde5d1 222 'captype' => 'write',
f2a0da6c 223 'contextlevel' => CONTEXT_COURSE,
31c93303 224 'archetypes' => array(
2fdde5d1 225 'editingteacher' => CAP_ALLOW,
4f0c2d00 226 'manager' => CAP_ALLOW
2fdde5d1
EL
227 ),
228
229 'clonepermissionsfrom' => 'moodle/site:restore'
f2a0da6c
EL
230 ),
231
57ca97b3
EL
232 'moodle/restore:restoresection' => array(
233
234 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
235
236 'captype' => 'write',
237 'contextlevel' => CONTEXT_COURSE,
31c93303 238 'archetypes' => array(
57ca97b3
EL
239 'editingteacher' => CAP_ALLOW,
240 'manager' => CAP_ALLOW
241 ),
242
243 'clonepermissionsfrom' => 'moodle/restore:restorecourse'
244 ),
245
246 'moodle/restore:restoreactivity' => array(
247
248 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
249
250 'captype' => 'write',
251 'contextlevel' => CONTEXT_MODULE,
31c93303 252 'archetypes' => array(
57ca97b3
EL
253 'editingteacher' => CAP_ALLOW,
254 'manager' => CAP_ALLOW
255 ),
256
257 'clonepermissionsfrom' => 'moodle/restore:restorecourse'
258 ),
259
260 'moodle/restore:restoretargethub' => array(
261
262 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
263
264 'captype' => 'write',
265 'contextlevel' => CONTEXT_COURSE,
31c93303 266 'archetypes' => array(
57ca97b3
EL
267 'editingteacher' => CAP_ALLOW,
268 'manager' => CAP_ALLOW
269 ),
270
271 'clonepermissionsfrom' => 'moodle/restore:restorecourse'
272 ),
273
157aa3a2 274 'moodle/restore:restoretargetimport' => array(
eef868d1 275
21b6db6e 276 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
277
bbbf2d40 278 'captype' => 'write',
f432bebf 279 'contextlevel' => CONTEXT_COURSE,
31c93303 280 'archetypes' => array(
7246585a 281 'editingteacher' => CAP_ALLOW,
4f0c2d00 282 'manager' => CAP_ALLOW
d2940003
EL
283 ),
284
157aa3a2 285 'clonepermissionsfrom' => 'moodle/site:import'
bbbf2d40 286 ),
eef868d1 287
157aa3a2 288 'moodle/restore:uploadfile' => array(
5e934890 289
157aa3a2 290 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
5e934890
EL
291
292 'captype' => 'write',
157aa3a2 293 'contextlevel' => CONTEXT_COURSE,
31c93303 294 'archetypes' => array(
157aa3a2 295 'editingteacher' => CAP_ALLOW,
4f0c2d00 296 'manager' => CAP_ALLOW
157aa3a2
EL
297 ),
298
299 'clonepermissionsfrom' => 'moodle/site:backupupload'
5e934890
EL
300 ),
301
57ca97b3 302 'moodle/restore:configure' => array(
f6459d12 303
57ca97b3 304 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
f6459d12
EL
305
306 'captype' => 'write',
307 'contextlevel' => CONTEXT_COURSE,
31c93303 308 'archetypes' => array(
57ca97b3 309 'editingteacher' => CAP_ALLOW,
4f0c2d00 310 'manager' => CAP_ALLOW
f6459d12
EL
311 )
312 ),
313
57ca97b3 314 'moodle/restore:rolldates' => array(
157aa3a2
EL
315
316 'captype' => 'write',
57ca97b3 317 'contextlevel' => CONTEXT_COURSE,
31c93303 318 'archetypes' => array(
57ca97b3 319 'coursecreator' => CAP_ALLOW,
4f0c2d00 320 'manager' => CAP_ALLOW
157aa3a2
EL
321 )
322 ),
323
57ca97b3
EL
324 'moodle/restore:userinfo' => array(
325
326 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
982e45af 327
328 'captype' => 'write',
329 'contextlevel' => CONTEXT_COURSE,
31c93303 330 'archetypes' => array(
57ca97b3
EL
331 'manager' => CAP_ALLOW
332 )
333 ),
334
335 'moodle/restore:createuser' => array(
336
337 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
338
339 'captype' => 'write',
340 'contextlevel' => CONTEXT_SYSTEM,
31c93303 341 'archetypes' => array(
4f0c2d00 342 'manager' => CAP_ALLOW
982e45af 343 )
344 ),
345
bbbf2d40 346 'moodle/site:manageblocks' => array(
eef868d1 347
21b6db6e 348 'riskbitmask' => RISK_SPAM | RISK_XSS,
349
bbbf2d40 350 'captype' => 'write',
f432bebf 351 'contextlevel' => CONTEXT_BLOCK,
31c93303 352 'archetypes' => array(
73b73d21 353 'editingteacher' => CAP_ALLOW,
4f0c2d00 354 'manager' => CAP_ALLOW
bbbf2d40 355 )
356 ),
eef868d1 357
27950688 358 'moodle/site:accessallgroups' => array(
eef868d1 359
27950688 360 'captype' => 'read',
f432bebf 361 'contextlevel' => CONTEXT_COURSE,
31c93303 362 'archetypes' => array(
27950688 363 'teacher' => CAP_ALLOW,
364 'editingteacher' => CAP_ALLOW,
4f0c2d00 365 'manager' => CAP_ALLOW
27950688 366 )
367 ),
eef868d1 368
53d7785b 369 'moodle/site:viewfullnames' => array(
eef868d1 370
53d7785b 371 'captype' => 'read',
f432bebf 372 'contextlevel' => CONTEXT_COURSE,
31c93303 373 'archetypes' => array(
53d7785b 374 'teacher' => CAP_ALLOW,
375 'editingteacher' => CAP_ALLOW,
4f0c2d00 376 'manager' => CAP_ALLOW
53d7785b 377 )
378 ),
eef868d1 379
a028c291 380 'moodle/site:viewreports' => array(
eef868d1 381
21b6db6e 382 'riskbitmask' => RISK_PERSONAL,
383
a028c291 384 'captype' => 'read',
f432bebf 385 'contextlevel' => CONTEXT_COURSE,
31c93303 386 'archetypes' => array(
a028c291 387 'teacher' => CAP_ALLOW,
388 'editingteacher' => CAP_ALLOW,
4f0c2d00 389 'manager' => CAP_ALLOW
a028c291 390 )
391 ),
eef868d1 392
7d8a3cb0 393 'moodle/site:trustcontent' => array(
eef868d1 394
21b6db6e 395 'riskbitmask' => RISK_XSS,
396
7d8a3cb0 397 'captype' => 'write',
f432bebf 398 'contextlevel' => CONTEXT_COURSE,
31c93303 399 'archetypes' => array(
7d8a3cb0 400 'editingteacher' => CAP_ALLOW,
4f0c2d00 401 'manager' => CAP_ALLOW
7d8a3cb0 402 )
403 ),
eef868d1 404
6df3c7df 405 'moodle/site:uploadusers' => array(
eef868d1 406
21b6db6e 407 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
408
bbbf2d40 409 'captype' => 'write',
410 'contextlevel' => CONTEXT_SYSTEM,
31c93303 411 'archetypes' => array(
4f0c2d00 412 'manager' => CAP_ALLOW
bbbf2d40 413 )
414 ),
eef868d1 415
2a55410b 416 'moodle/site:langeditmaster' => array(
417
418 'riskbitmask' => RISK_CONFIG | RISK_XSS,
419
420 'captype' => 'write',
421 'contextlevel' => CONTEXT_SYSTEM,
31c93303 422 'archetypes' => array(
2a55410b 423 )
424 ),
425
426 'moodle/site:langeditlocal' => array(
427
428 'riskbitmask' => RISK_CONFIG | RISK_XSS,
429
430 'captype' => 'write',
431 'contextlevel' => CONTEXT_SYSTEM,
31c93303 432 'archetypes' => array(
4f0c2d00 433 'manager' => CAP_ALLOW
2a55410b 434 )
435 ),
436
94211250 437 // Permission to manage filter setting overrides in subcontexts.
438 'moodle/filter:manage' => array(
439
440 'captype' => 'write',
441 'contextlevel' => CONTEXT_COURSE,
31c93303 442 'archetypes' => array(
94211250 443 'editingteacher' => CAP_ALLOW,
444 'coursecreator' => CAP_ALLOW,
4f0c2d00 445 'manager' => CAP_ALLOW,
94211250 446 )
447 ),
6df3c7df 448
449 'moodle/user:create' => array(
450
451 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
eef868d1 452
bbbf2d40 453 'captype' => 'write',
454 'contextlevel' => CONTEXT_SYSTEM,
31c93303 455 'archetypes' => array(
4f0c2d00 456 'manager' => CAP_ALLOW
bbbf2d40 457 )
458 ),
eef868d1 459
6df3c7df 460 'moodle/user:delete' => array(
cc891abe 461
3a0c6cca 462 'riskbitmask' => RISK_PERSONAL, RISK_DATALOSS,
bcdb0f19 463
cc891abe 464 'captype' => 'write',
465 'contextlevel' => CONTEXT_SYSTEM,
31c93303 466 'archetypes' => array(
4f0c2d00 467 'manager' => CAP_ALLOW
cc891abe 468 )
469 ),
470
6df3c7df 471 'moodle/user:update' => array(
cc891abe 472
473 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
21b6db6e 474
bbbf2d40 475 'captype' => 'write',
476 'contextlevel' => CONTEXT_SYSTEM,
31c93303 477 'archetypes' => array(
4f0c2d00 478 'manager' => CAP_ALLOW
bbbf2d40 479 )
480 ),
eef868d1 481
bbbf2d40 482 'moodle/user:viewdetails' => array(
eef868d1 483
e58eca72 484 'captype' => 'read',
f432bebf 485 'contextlevel' => CONTEXT_COURSE,
31c93303 486 'archetypes' => array(
22ae509e 487 'guest' => CAP_ALLOW,
488 'student' => CAP_ALLOW,
489 'teacher' => CAP_ALLOW,
490 'editingteacher' => CAP_ALLOW,
4f0c2d00 491 'manager' => CAP_ALLOW
bbbf2d40 492 )
493 ),
e58eca72 494
495 'moodle/user:viewhiddendetails' => array(
eef868d1 496
21b6db6e 497 'riskbitmask' => RISK_PERSONAL,
498
e58eca72 499 'captype' => 'read',
f432bebf 500 'contextlevel' => CONTEXT_COURSE,
31c93303 501 'archetypes' => array(
e58eca72 502 'teacher' => CAP_ALLOW,
503 'editingteacher' => CAP_ALLOW,
4f0c2d00 504 'manager' => CAP_ALLOW
e58eca72 505 )
506 ),
eef868d1 507
6c95827f 508 'moodle/user:loginas' => array(
509
510 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
511
512 'captype' => 'write',
513 'contextlevel' => CONTEXT_COURSE,
31c93303 514 'archetypes' => array(
4f0c2d00 515 'manager' => CAP_ALLOW
6c95827f 516 )
517 ),
518
03d9401e
MD
519 // can the user manage the system default profile page?
520 'moodle/user:managesyspages' => array(
521
522 'riskbitmap' => RISK_SPAM | RISK_PERSONAL | RISK_CONFIG,
523
524 'captype' => 'write',
525 'contextlevel' => CONTEXT_SYSTEM,
31c93303 526 'archetypes' => array(
03d9401e
MD
527 'manager' => CAP_ALLOW
528 )
529 ),
530
531 // can the user manage another user's profile page?
532 'moodle/user:manageblocks' => array(
533
534 'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
535
536 'captype' => 'write',
537 'contextlevel' => CONTEXT_USER
538 ),
539
540 // can the user manage their own profile page?
541 'moodle/user:manageownblocks' => array(
542
543 'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
544
545 'captype' => 'write',
546 'contextlevel' => CONTEXT_SYSTEM,
31c93303 547 'archetypes' => array(
e4f413b4
MD
548 'user' => CAP_ALLOW
549 )
550 ),
551
552 // can the user manage their own files?
553 'moodle/user:manageownfiles' => array(
554
555 'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
556
557 'captype' => 'write',
558 'contextlevel' => CONTEXT_SYSTEM,
559 'archetypes' => array(
560 'user' => CAP_ALLOW
03d9401e
MD
561 )
562 ),
563
564 // can the user manage the system default dashboard page?
565 'moodle/my:configsyspages' => array(
566
567 'riskbitmap' => RISK_SPAM | RISK_PERSONAL | RISK_CONFIG,
568
569 'captype' => 'write',
570 'contextlevel' => CONTEXT_SYSTEM,
31c93303 571 'archetypes' => array(
03d9401e
MD
572 'manager' => CAP_ALLOW
573 )
574 ),
575
bbbf2d40 576 'moodle/role:assign' => array(
eef868d1 577
3a0c6cca 578 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
579
bbbf2d40 580 'captype' => 'write',
f432bebf 581 'contextlevel' => CONTEXT_COURSE,
31c93303 582 'archetypes' => array(
861fdcaa 583 'editingteacher' => CAP_ALLOW,
4f0c2d00 584 'manager' => CAP_ALLOW
68c52526 585 )
586 ),
eef868d1 587
01a2ce80
PS
588 'moodle/role:review' => array(
589
590 'riskbitmask' => RISK_PERSONAL,
591
592 'captype' => 'read',
593 'contextlevel' => CONTEXT_COURSE,
31c93303 594 'archetypes' => array(
01a2ce80
PS
595 'teacher' => CAP_ALLOW,
596 'editingteacher' => CAP_ALLOW,
4f0c2d00 597 'manager' => CAP_ALLOW
01a2ce80
PS
598 )
599 ),
600
68c52526 601 'moodle/role:override' => array(
eef868d1 602
bcdb0f19 603 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
604
68c52526 605 'captype' => 'write',
f432bebf 606 'contextlevel' => CONTEXT_COURSE,
31c93303 607 'archetypes' => array(
4f0c2d00 608 'manager' => CAP_ALLOW
bbbf2d40 609 )
610 ),
eef868d1 611
3a0c6cca 612 'moodle/role:safeoverride' => array(
613
614 'riskbitmask' => RISK_SPAM,
615
616 'captype' => 'write',
f432bebf 617 'contextlevel' => CONTEXT_COURSE,
31c93303 618 'archetypes' => array(
3a0c6cca 619 'editingteacher' => CAP_ALLOW
620 )
621 ),
622
bbbf2d40 623 'moodle/role:manage' => array(
eef868d1 624
bcdb0f19 625 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
626
bbbf2d40 627 'captype' => 'write',
628 'contextlevel' => CONTEXT_SYSTEM,
31c93303 629 'archetypes' => array(
4f0c2d00 630 'manager' => CAP_ALLOW
bbbf2d40 631 )
632 ),
f43ce1ad 633
20dd4cf5 634 'moodle/role:switchroles' => array(
bcdb0f19 635
3a0c6cca 636 'riskbitmask' => RISK_XSS | RISK_PERSONAL,
bcdb0f19 637
20dd4cf5 638 'captype' => 'read',
f432bebf 639 'contextlevel' => CONTEXT_COURSE,
31c93303 640 'archetypes' => array(
20dd4cf5 641 'editingteacher' => CAP_ALLOW,
4f0c2d00 642 'manager' => CAP_ALLOW
20dd4cf5 643 )
644 ),
645
8ed5dd63 646 // Create, update and delete course categories. (Deleting a course category
647 // does not let you delete the courses it contains, unless you also have
648 // moodle/course: delete.) Creating and deleting requires this permission in
649 // the parent category.
650 'moodle/category:manage' => array(
eef868d1 651
89a792ab 652 'riskbitmask' => RISK_XSS,
653
bbbf2d40 654 'captype' => 'write',
655 'contextlevel' => CONTEXT_COURSECAT,
31c93303 656 'archetypes' => array(
4f0c2d00 657 'manager' => CAP_ALLOW
8ed5dd63 658 ),
659 'clonepermissionsfrom' => 'moodle/category:update'
bbbf2d40 660 ),
eef868d1 661
8ed5dd63 662 'moodle/category:viewhiddencategories' => array(
eef868d1 663
8ed5dd63 664 'captype' => 'read',
bbbf2d40 665 'contextlevel' => CONTEXT_COURSECAT,
31c93303 666 'archetypes' => array(
8ed5dd63 667 'coursecreator' => CAP_ALLOW,
4f0c2d00 668 'manager' => CAP_ALLOW
8ed5dd63 669 ),
670 'clonepermissionsfrom' => 'moodle/category:visibility'
bbbf2d40 671 ),
eef868d1 672
3f791403
PS
673 // create, delete, move cohorts in system and course categories,
674 // (cohorts with component !== null can be only moved)
675 'moodle/cohort:manage' => array(
676
677 'captype' => 'write',
678 'contextlevel' => CONTEXT_COURSECAT,
31c93303 679 'archetypes' => array(
3f791403
PS
680 'manager' => CAP_ALLOW
681 )
682 ),
683
684 // add and remove cohort members (only for cohorts where component !== null)
685 'moodle/cohort:assign' => array(
686
687 'captype' => 'write',
688 'contextlevel' => CONTEXT_COURSECAT,
31c93303 689 'archetypes' => array(
3f791403
PS
690 'manager' => CAP_ALLOW
691 )
692 ),
693
694 // view members of a cohort, this can be used in course context too,
695 // this also controls the ability to actually use cohort
696 'moodle/cohort:view' => array(
697
698 'captype' => 'read',
699 'contextlevel' => CONTEXT_COURSE,
31c93303 700 'archetypes' => array(
3f791403
PS
701 'editingteacher' => CAP_ALLOW,
702 'manager' => CAP_ALLOW
703 )
704 ),
705
bbbf2d40 706 'moodle/course:create' => array(
eef868d1 707
21b6db6e 708 'riskbitmask' => RISK_XSS,
709
bbbf2d40 710 'captype' => 'write',
5e992f56 711 'contextlevel' => CONTEXT_COURSECAT,
31c93303 712 'archetypes' => array(
4473252d 713 'coursecreator' => CAP_ALLOW,
4f0c2d00 714 'manager' => CAP_ALLOW
bbbf2d40 715 )
716 ),
eef868d1 717
e452210a 718 'moodle/course:request' => array(
719 'captype' => 'write',
720 'contextlevel' => CONTEXT_SYSTEM,
31c93303 721 'archetypes' => array(
e452210a 722 'user' => CAP_ALLOW,
723 )
724 ),
725
bbbf2d40 726 'moodle/course:delete' => array(
eef868d1 727
3a0c6cca 728 'riskbitmask' => RISK_DATALOSS,
729
bbbf2d40 730 'captype' => 'write',
731 'contextlevel' => CONTEXT_COURSE,
31c93303 732 'archetypes' => array(
9136a60c 733 'editingteacher' => CAP_ALLOW,
4f0c2d00 734 'manager' => CAP_ALLOW
bbbf2d40 735 )
736 ),
eef868d1 737
bbbf2d40 738 'moodle/course:update' => array(
eef868d1 739
21b6db6e 740 'riskbitmask' => RISK_XSS,
741
bbbf2d40 742 'captype' => 'write',
743 'contextlevel' => CONTEXT_COURSE,
31c93303 744 'archetypes' => array(
bbbf2d40 745 'editingteacher' => CAP_ALLOW,
4f0c2d00 746 'manager' => CAP_ALLOW
bbbf2d40 747 )
748 ),
eef868d1 749
df997f84 750 'moodle/course:view' => array(
eef868d1 751
bbbf2d40 752 'captype' => 'read',
753 'contextlevel' => CONTEXT_COURSE,
31c93303 754 'archetypes' => array(
df997f84 755 'manager' => CAP_ALLOW,
bbbf2d40 756 )
757 ),
eef868d1 758
df997f84
PS
759 /* review course enrolments - no group restrictions, it is really full access to all participants info*/
760 'moodle/course:enrolreview' => array(
761
762 'riskbitmask' => RISK_PERSONAL,
4f0c2d00
PS
763
764 'captype' => 'read',
765 'contextlevel' => CONTEXT_COURSE,
31c93303 766 'archetypes' => array(
df997f84
PS
767 'editingteacher' => CAP_ALLOW,
768 'manager' => CAP_ALLOW,
769 )
770 ),
771
772 /* add, remove, hide enrol instances in courses */
773 'moodle/course:enrolconfig' => array(
774
775 'riskbitmask' => RISK_PERSONAL,
776
777 'captype' => 'write',
778 'contextlevel' => CONTEXT_COURSE,
779 'archetypes' => array(
780 'editingteacher' => CAP_ALLOW,
4f0c2d00
PS
781 'manager' => CAP_ALLOW,
782 )
783 ),
784
77c645df 785 'moodle/course:bulkmessaging' => array(
786
787 'riskbitmask' => RISK_SPAM,
788
789 'captype' => 'write',
790 'contextlevel' => CONTEXT_COURSE,
31c93303 791 'archetypes' => array(
77c645df 792 'teacher' => CAP_ALLOW,
793 'editingteacher' => CAP_ALLOW,
4f0c2d00 794 'manager' => CAP_ALLOW
77c645df 795 )
796 ),
797
1c45e42e 798 'moodle/course:viewhiddenuserfields' => array(
eef868d1 799
21b6db6e 800 'riskbitmask' => RISK_PERSONAL,
4e781c7b 801
802 'captype' => 'read',
803 'contextlevel' => CONTEXT_COURSE,
31c93303 804 'archetypes' => array(
4e781c7b 805 'teacher' => CAP_ALLOW,
806 'editingteacher' => CAP_ALLOW,
4f0c2d00 807 'manager' => CAP_ALLOW
4e781c7b 808 )
809 ),
810
1c45e42e 811 'moodle/course:viewhiddencourses' => array(
eef868d1 812
1c45e42e 813 'captype' => 'read',
814 'contextlevel' => CONTEXT_COURSE,
31c93303 815 'archetypes' => array(
2f5ab42b 816 'coursecreator' => CAP_ALLOW,
817 'teacher' => CAP_ALLOW,
818 'editingteacher' => CAP_ALLOW,
4f0c2d00 819 'manager' => CAP_ALLOW
1c45e42e 820 )
821 ),
eef868d1 822
bbbf2d40 823 'moodle/course:visibility' => array(
eef868d1 824
bbbf2d40 825 'captype' => 'write',
826 'contextlevel' => CONTEXT_COURSE,
31c93303 827 'archetypes' => array(
df997f84 828 'editingteacher' => CAP_ALLOW,
4f0c2d00 829 'manager' => CAP_ALLOW
bbbf2d40 830 )
831 ),
eef868d1 832
a028c291 833 'moodle/course:managefiles' => array(
eef868d1 834
21b6db6e 835 'riskbitmask' => RISK_XSS,
836
a028c291 837 'captype' => 'write',
838 'contextlevel' => CONTEXT_COURSE,
31c93303 839 'archetypes' => array(
a028c291 840 'editingteacher' => CAP_ALLOW,
4f0c2d00 841 'manager' => CAP_ALLOW
a028c291 842 )
843 ),
eef868d1 844
bbbf2d40 845 'moodle/course:manageactivities' => array(
eef868d1 846
21b6db6e 847 'riskbitmask' => RISK_XSS,
848
bbbf2d40 849 'captype' => 'write',
850 'contextlevel' => CONTEXT_COURSE,
31c93303 851 'archetypes' => array(
bbbf2d40 852 'editingteacher' => CAP_ALLOW,
4f0c2d00 853 'manager' => CAP_ALLOW
bbbf2d40 854 )
855 ),
eef868d1 856
bbbf2d40 857 'moodle/course:activityvisibility' => array(
eef868d1 858
bbbf2d40 859 'captype' => 'write',
860 'contextlevel' => CONTEXT_COURSE,
31c93303 861 'archetypes' => array(
bbbf2d40 862 'editingteacher' => CAP_ALLOW,
4f0c2d00 863 'manager' => CAP_ALLOW
bbbf2d40 864 )
865 ),
eef868d1 866
bbbf2d40 867 'moodle/course:viewhiddenactivities' => array(
eef868d1 868
bbbf2d40 869 'captype' => 'write',
870 'contextlevel' => CONTEXT_COURSE,
31c93303 871 'archetypes' => array(
bbbf2d40 872 'teacher' => CAP_ALLOW,
873 'editingteacher' => CAP_ALLOW,
4f0c2d00 874 'manager' => CAP_ALLOW
bbbf2d40 875 )
876 ),
eef868d1 877
bbbf2d40 878 'moodle/course:viewparticipants' => array(
eef868d1 879
bbbf2d40 880 'captype' => 'read',
881 'contextlevel' => CONTEXT_COURSE,
31c93303 882 'archetypes' => array(
bbbf2d40 883 'student' => CAP_ALLOW,
884 'teacher' => CAP_ALLOW,
885 'editingteacher' => CAP_ALLOW,
4f0c2d00 886 'manager' => CAP_ALLOW
165088f6 887 )
888 ),
f7c0d84b 889
890 'moodle/course:changefullname' => array(
891
cd7f72c0 892 'riskbitmask' => RISK_XSS,
893
f7c0d84b 894 'captype' => 'write',
895 'contextlevel' => CONTEXT_COURSE,
31c93303 896 'archetypes' => array(
f7c0d84b 897 'editingteacher' => CAP_ALLOW,
4f0c2d00 898 'manager' => CAP_ALLOW
5e99b9d7 899 ),
900 'clonepermissionsfrom' => 'moodle/course:update'
f7c0d84b 901 ),
902
903 'moodle/course:changeshortname' => array(
904
cd7f72c0 905 'riskbitmask' => RISK_XSS,
906
f7c0d84b 907 'captype' => 'write',
908 'contextlevel' => CONTEXT_COURSE,
31c93303 909 'archetypes' => array(
f7c0d84b 910 'editingteacher' => CAP_ALLOW,
4f0c2d00 911 'manager' => CAP_ALLOW
5e99b9d7 912 ),
913 'clonepermissionsfrom' => 'moodle/course:update'
f7c0d84b 914 ),
915
916 'moodle/course:changeidnumber' => array(
917
cd7f72c0 918 'riskbitmask' => RISK_XSS,
919
f7c0d84b 920 'captype' => 'write',
921 'contextlevel' => CONTEXT_COURSE,
31c93303 922 'archetypes' => array(
f7c0d84b 923 'editingteacher' => CAP_ALLOW,
4f0c2d00 924 'manager' => CAP_ALLOW
5e99b9d7 925 ),
926 'clonepermissionsfrom' => 'moodle/course:update'
f7c0d84b 927 ),
50569ba3 928 'moodle/course:changecategory' => array(
929 'riskbitmask' => RISK_XSS,
930
931 'captype' => 'write',
932 'contextlevel' => CONTEXT_COURSE,
31c93303 933 'archetypes' => array(
50569ba3 934 'editingteacher' => CAP_ALLOW,
4f0c2d00 935 'manager' => CAP_ALLOW
50569ba3 936 ),
937 'clonepermissionsfrom' => 'moodle/course:update'
938 ),
939
940 'moodle/course:changesummary' => array(
941 'riskbitmask' => RISK_XSS,
942
943 'captype' => 'write',
944 'contextlevel' => CONTEXT_COURSE,
31c93303 945 'archetypes' => array(
50569ba3 946 'editingteacher' => CAP_ALLOW,
4f0c2d00 947 'manager' => CAP_ALLOW
50569ba3 948 ),
949 'clonepermissionsfrom' => 'moodle/course:update'
950 ),
951
f7c0d84b 952
165088f6 953 'moodle/site:viewparticipants' => array(
954
955 'captype' => 'read',
956 'contextlevel' => CONTEXT_SYSTEM,
31c93303 957 'archetypes' => array(
4f0c2d00 958 'manager' => CAP_ALLOW
bbbf2d40 959 )
960 ),
eef868d1 961
bbbf2d40 962 'moodle/course:viewscales' => array(
eef868d1 963
bbbf2d40 964 'captype' => 'read',
965 'contextlevel' => CONTEXT_COURSE,
31c93303 966 'archetypes' => array(
bbbf2d40 967 'student' => CAP_ALLOW,
968 'teacher' => CAP_ALLOW,
969 'editingteacher' => CAP_ALLOW,
4f0c2d00 970 'manager' => CAP_ALLOW
bbbf2d40 971 )
972 ),
eef868d1 973
bbbf2d40 974 'moodle/course:managescales' => array(
eef868d1 975
bbbf2d40 976 'captype' => 'write',
977 'contextlevel' => CONTEXT_COURSE,
31c93303 978 'archetypes' => array(
bbbf2d40 979 'editingteacher' => CAP_ALLOW,
4f0c2d00 980 'manager' => CAP_ALLOW
bbbf2d40 981 )
982 ),
eef868d1 983
bbbf2d40 984 'moodle/course:managegroups' => array(
985
986 'captype' => 'write',
987 'contextlevel' => CONTEXT_COURSE,
31c93303 988 'archetypes' => array(
a028c291 989 'editingteacher' => CAP_ALLOW,
4f0c2d00 990 'manager' => CAP_ALLOW
a028c291 991 )
992 ),
eef868d1 993
a028c291 994 'moodle/course:reset' => array(
995
3a0c6cca 996 'riskbitmask' => RISK_DATALOSS,
997
a028c291 998 'captype' => 'write',
999 'contextlevel' => CONTEXT_COURSE,
31c93303 1000 'archetypes' => array(
bbbf2d40 1001 'editingteacher' => CAP_ALLOW,
4f0c2d00 1002 'manager' => CAP_ALLOW
bbbf2d40 1003 )
1004 ),
eef868d1 1005
bbbf2d40 1006 'moodle/blog:view' => array(
1007
1008 'captype' => 'read',
05de723b 1009 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1010 'archetypes' => array(
05de723b
NC
1011 'guest' => CAP_ALLOW,
1012 'user' => CAP_ALLOW,
1013 'student' => CAP_ALLOW,
1014 'teacher' => CAP_ALLOW,
1015 'editingteacher' => CAP_ALLOW,
4f0c2d00 1016 'manager' => CAP_ALLOW
05de723b
NC
1017 )
1018 ),
1019
1020 'moodle/blog:search' => array(
1021 'captype' => 'read',
1022 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1023 'archetypes' => array(
00adf177 1024 'guest' => CAP_ALLOW,
c785d40a 1025 'user' => CAP_ALLOW,
bbbf2d40 1026 'student' => CAP_ALLOW,
1027 'teacher' => CAP_ALLOW,
1028 'editingteacher' => CAP_ALLOW,
4f0c2d00 1029 'manager' => CAP_ALLOW
bbbf2d40 1030 )
1031 ),
eef868d1 1032
05de723b
NC
1033 'moodle/blog:viewdrafts' => array(
1034
1035 'riskbitmask' => RISK_PERSONAL,
1036 'captype' => 'read',
1037 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1038 'archetypes' => array(
4f0c2d00 1039 'manager' => CAP_ALLOW
05de723b
NC
1040 )
1041 ),
1042
5a8ab2e9 1043 'moodle/blog:create' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 1044
21b6db6e 1045 'riskbitmask' => RISK_SPAM,
1046
bbbf2d40 1047 'captype' => 'write',
1048 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1049 'archetypes' => array(
c785d40a 1050 'user' => CAP_ALLOW,
4f0c2d00 1051 'manager' => CAP_ALLOW
bbbf2d40 1052 )
1053 ),
eef868d1 1054
bbbf2d40 1055 'moodle/blog:manageentries' => array(
1056
21b6db6e 1057 'riskbitmask' => RISK_SPAM,
1058
bbbf2d40 1059 'captype' => 'write',
05de723b 1060 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1061 'archetypes' => array(
bbbf2d40 1062 'teacher' => CAP_ALLOW,
1063 'editingteacher' => CAP_ALLOW,
4f0c2d00 1064 'manager' => CAP_ALLOW
bbbf2d40 1065 )
1066 ),
05de723b 1067
cae83708 1068 'moodle/blog:manageexternal' => array(
1069
1070 'riskbitmask' => RISK_SPAM,
1071
1072 'captype' => 'write',
1073 'contextlevel' => CONTEXT_USER,
31c93303 1074 'archetypes' => array(
cae83708 1075 'student' => CAP_ALLOW,
1076 'user' => CAP_ALLOW,
1077 'teacher' => CAP_ALLOW,
1078 'editingteacher' => CAP_ALLOW,
4f0c2d00 1079 'manager' => CAP_ALLOW
cae83708 1080 )
1081 ),
1082
05de723b
NC
1083 'moodle/blog:associatecourse' => array(
1084
1085 'captype' => 'write',
1086 'contextlevel' => CONTEXT_COURSE,
31c93303 1087 'archetypes' => array(
05de723b
NC
1088 'student' => CAP_ALLOW,
1089 'user' => CAP_ALLOW,
1090 'teacher' => CAP_ALLOW,
1091 'editingteacher' => CAP_ALLOW,
4f0c2d00 1092 'manager' => CAP_ALLOW
05de723b
NC
1093 )
1094 ),
1095
1096 'moodle/blog:associatemodule' => array(
1097
1098 'captype' => 'write',
1099 'contextlevel' => CONTEXT_MODULE,
31c93303 1100 'archetypes' => array(
05de723b
NC
1101 'student' => CAP_ALLOW,
1102 'user' => CAP_ALLOW,
1103 'teacher' => CAP_ALLOW,
1104 'editingteacher' => CAP_ALLOW,
4f0c2d00 1105 'manager' => CAP_ALLOW
05de723b
NC
1106 )
1107 ),
eef868d1 1108
5a8ab2e9 1109 'moodle/calendar:manageownentries' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 1110
21b6db6e 1111 'riskbitmask' => RISK_SPAM,
1112
bbbf2d40 1113 'captype' => 'write',
f432bebf 1114 'contextlevel' => CONTEXT_COURSE,
31c93303 1115 'archetypes' => array(
c785d40a 1116 'user' => CAP_ALLOW,
4f0c2d00 1117 'manager' => CAP_ALLOW
bbbf2d40 1118 )
1119 ),
eef868d1 1120
f63d2922 1121 'moodle/calendar:managegroupentries' => array(
1122
1123 'riskbitmask' => RISK_SPAM,
1124
1125 'captype' => 'write',
f432bebf 1126 'contextlevel' => CONTEXT_COURSE,
31c93303 1127 'archetypes' => array(
f63d2922 1128 'teacher' => CAP_ALLOW,
1129 'editingteacher' => CAP_ALLOW,
4f0c2d00 1130 'manager' => CAP_ALLOW
f63d2922 1131 )
1132 ),
1133
bbbf2d40 1134 'moodle/calendar:manageentries' => array(
1135
21b6db6e 1136 'riskbitmask' => RISK_SPAM,
1137
bbbf2d40 1138 'captype' => 'write',
f432bebf 1139 'contextlevel' => CONTEXT_COURSE,
31c93303 1140 'archetypes' => array(
bbbf2d40 1141 'teacher' => CAP_ALLOW,
1142 'editingteacher' => CAP_ALLOW,
4f0c2d00 1143 'manager' => CAP_ALLOW
bbbf2d40 1144 )
77d4953e 1145 ),
a044c05d 1146
1147 'moodle/user:editprofile' => array(
1148
3a0c6cca 1149 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
a044c05d 1150
1151 'captype' => 'write',
1152 'contextlevel' => CONTEXT_USER,
31c93303 1153 'archetypes' => array(
4f0c2d00 1154 'manager' => CAP_ALLOW
a044c05d 1155 )
1156 ),
eef868d1 1157
a5b8be62 1158 'moodle/user:editownprofile' => array(
1cb3da36 1159
3a0c6cca 1160 'riskbitmask' => RISK_SPAM,
1161
a5b8be62 1162 'captype' => 'write',
1163 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1164 'archetypes' => array(
1cb3da36 1165 'guest' => CAP_PROHIBIT,
1166 'user' => CAP_ALLOW,
4f0c2d00 1167 'manager' => CAP_ALLOW
a5b8be62 1168 )
1cb3da36 1169 ),
1170
a5b8be62 1171 'moodle/user:changeownpassword' => array(
1cb3da36 1172
a5b8be62 1173 'captype' => 'write',
1174 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1175 'archetypes' => array(
1cb3da36 1176 'guest' => CAP_PROHIBIT,
1177 'user' => CAP_ALLOW,
4f0c2d00 1178 'manager' => CAP_ALLOW
a5b8be62 1179 )
1cb3da36 1180 ),
1181
eef868d1 1182 // The next 3 might make no sense for some roles, e.g teacher, etc.
77d4953e 1183 // since the next level up is site. These are more for the parent role
1184 'moodle/user:readuserposts' => array(
bcdb0f19 1185
77d4953e 1186 'captype' => 'read',
4b10f08b 1187 'contextlevel' => CONTEXT_USER,
31c93303 1188 'archetypes' => array(
77d4953e 1189 'student' => CAP_ALLOW,
1190 'teacher' => CAP_ALLOW,
1191 'editingteacher' => CAP_ALLOW,
4f0c2d00 1192 'manager' => CAP_ALLOW
77d4953e 1193 )
1194 ),
eef868d1 1195
77d4953e 1196 'moodle/user:readuserblogs' => array(
bcdb0f19 1197
77d4953e 1198 'captype' => 'read',
4b10f08b 1199 'contextlevel' => CONTEXT_USER,
31c93303 1200 'archetypes' => array(
77d4953e 1201 'student' => CAP_ALLOW,
1202 'teacher' => CAP_ALLOW,
1203 'editingteacher' => CAP_ALLOW,
4f0c2d00 1204 'manager' => CAP_ALLOW
77d4953e 1205 )
1206 ),
eef868d1 1207
3c7da16d 1208 // designed for parent role - not used in legacy roles
77d4953e 1209 'moodle/user:viewuseractivitiesreport' => array(
3c7da16d 1210 'riskbitmask' => RISK_PERSONAL,
bcdb0f19 1211
77d4953e 1212 'captype' => 'read',
4b10f08b 1213 'contextlevel' => CONTEXT_USER,
31c93303 1214 'archetypes' => array(
77d4953e 1215 )
945f88ca 1216 ),
4e781c7b 1217
3b120e46 1218 //capabilities designed for the new message system configuration
1219 'moodle/user:editmessageprofile' => array(
f7c0d84b 1220
3b120e46 1221 'riskbitmask' => RISK_SPAM,
f7c0d84b 1222
3b120e46 1223 'captype' => 'write',
1224 'contextlevel' => CONTEXT_USER,
31c93303 1225 'archetypes' => array(
4f0c2d00 1226 'manager' => CAP_ALLOW
3b120e46 1227 )
1228 ),
f7c0d84b 1229
1230 'moodle/user:editownmessageprofile' => array(
1231
1232 'captype' => 'write',
1233 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1234 'archetypes' => array(
3b120e46 1235 'guest' => CAP_PROHIBIT,
1236 'user' => CAP_ALLOW,
4f0c2d00 1237 'manager' => CAP_ALLOW
f7c0d84b 1238 )
3b120e46 1239 ),
eef868d1 1240
271e6dec 1241 'moodle/question:managecategory' => array(
14d701d6 1242 'riskbitmask' => RISK_SPAM | RISK_XSS,
945f88ca 1243 'captype' => 'write',
1244 'contextlevel' => CONTEXT_COURSE,
31c93303 1245 'archetypes' => array(
945f88ca 1246 'editingteacher' => CAP_ALLOW,
4f0c2d00 1247 'manager' => CAP_ALLOW
945f88ca 1248 )
a5b8be62 1249 ),
1250
271e6dec 1251 //new in moodle 1.9
1252 'moodle/question:add' => array(
14d701d6 1253 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1254 'captype' => 'write',
1255 'contextlevel' => CONTEXT_COURSE,
31c93303 1256 'archetypes' => array(
271e6dec 1257 'editingteacher' => CAP_ALLOW,
4f0c2d00 1258 'manager' => CAP_ALLOW
271e6dec 1259 ),
1260 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1261 ),
271e6dec 1262 'moodle/question:editmine' => array(
14d701d6 1263 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1264 'captype' => 'write',
1265 'contextlevel' => CONTEXT_COURSE,
31c93303 1266 'archetypes' => array(
271e6dec 1267 'editingteacher' => CAP_ALLOW,
4f0c2d00 1268 'manager' => CAP_ALLOW
271e6dec 1269 ),
a5b8be62 1270 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1271 ),
1272 'moodle/question:editall' => array(
14d701d6 1273 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1274 'captype' => 'write',
1275 'contextlevel' => CONTEXT_COURSE,
31c93303 1276 'archetypes' => array(
271e6dec 1277 'editingteacher' => CAP_ALLOW,
4f0c2d00 1278 'manager' => CAP_ALLOW
271e6dec 1279 ),
a5b8be62 1280 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1281 ),
1282 'moodle/question:viewmine' => array(
945f88ca 1283 'captype' => 'read',
1284 'contextlevel' => CONTEXT_COURSE,
31c93303 1285 'archetypes' => array(
945f88ca 1286 'editingteacher' => CAP_ALLOW,
4f0c2d00 1287 'manager' => CAP_ALLOW
271e6dec 1288 ),
a5b8be62 1289 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1290 ),
271e6dec 1291 'moodle/question:viewall' => array(
1292 'captype' => 'read',
1293 'contextlevel' => CONTEXT_COURSE,
31c93303 1294 'archetypes' => array(
271e6dec 1295 'editingteacher' => CAP_ALLOW,
4f0c2d00 1296 'manager' => CAP_ALLOW
271e6dec 1297 ),
a5b8be62 1298 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1299 ),
1300 'moodle/question:usemine' => array(
1301 'captype' => 'read',
1302 'contextlevel' => CONTEXT_COURSE,
31c93303 1303 'archetypes' => array(
271e6dec 1304 'editingteacher' => CAP_ALLOW,
4f0c2d00 1305 'manager' => CAP_ALLOW
271e6dec 1306 ),
a5b8be62 1307 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1308 ),
1309 'moodle/question:useall' => array(
1310 'captype' => 'read',
1311 'contextlevel' => CONTEXT_COURSE,
31c93303 1312 'archetypes' => array(
271e6dec 1313 'editingteacher' => CAP_ALLOW,
4f0c2d00 1314 'manager' => CAP_ALLOW
271e6dec 1315 ),
a5b8be62 1316 'clonepermissionsfrom' => 'moodle/question:manage'
1317 ),
271e6dec 1318 'moodle/question:movemine' => array(
945f88ca 1319 'captype' => 'write',
1320 'contextlevel' => CONTEXT_COURSE,
31c93303 1321 'archetypes' => array(
945f88ca 1322 'editingteacher' => CAP_ALLOW,
4f0c2d00 1323 'manager' => CAP_ALLOW
271e6dec 1324 ),
a5b8be62 1325 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1326 ),
271e6dec 1327 'moodle/question:moveall' => array(
945f88ca 1328 'captype' => 'write',
1329 'contextlevel' => CONTEXT_COURSE,
31c93303 1330 'archetypes' => array(
945f88ca 1331 'editingteacher' => CAP_ALLOW,
4f0c2d00 1332 'manager' => CAP_ALLOW
271e6dec 1333 ),
a5b8be62 1334 'clonepermissionsfrom' => 'moodle/question:manage'
7191a1fa 1335 ),
271e6dec 1336 //END new in moodle 1.9
a5b8be62 1337
0eb6b04a 1338 // Configure the installed question types.
1339 'moodle/question:config' => array(
0eb6b04a 1340 'riskbitmask' => RISK_CONFIG,
0eb6b04a 1341 'captype' => 'write',
1342 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1343 'archetypes' => array(
4f0c2d00 1344 'manager' => CAP_ALLOW
0eb6b04a 1345 )
1346 ),
1347
62e76c67 1348 // While attempting questions, the ability to flag particular questions for later reference.
1349 'moodle/question:flag' => array(
1350 'captype' => 'write',
1351 'contextlevel' => CONTEXT_COURSE,
31c93303 1352 'archetypes' => array(
62e76c67 1353 'student' => CAP_ALLOW,
1354 'teacher' => CAP_ALLOW,
1355 'editingteacher' => CAP_ALLOW,
1356 'coursecreator' => CAP_ALLOW,
4f0c2d00 1357 'manager' => CAP_ALLOW
62e76c67 1358 )
1359 ),
bcdb0f19 1360
62e76c67 1361 'moodle/site:doclinks' => array(
7191a1fa 1362 'captype' => 'read',
1363 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1364 'archetypes' => array(
7191a1fa 1365 'teacher' => CAP_ALLOW,
1366 'editingteacher' => CAP_ALLOW,
4f0c2d00 1367 'manager' => CAP_ALLOW
7191a1fa 1368 )
3924b988 1369 ),
eef868d1 1370
3924b988 1371 'moodle/course:sectionvisibility' => array(
bcdb0f19 1372
3924b988 1373 'captype' => 'write',
1374 'contextlevel' => CONTEXT_COURSE,
31c93303 1375 'archetypes' => array(
3924b988 1376 'editingteacher' => CAP_ALLOW,
4f0c2d00 1377 'manager' => CAP_ALLOW
3924b988 1378 )
1379 ),
eef868d1 1380
dc558690 1381 'moodle/course:useremail' => array(
bcdb0f19 1382
dc558690 1383 'captype' => 'write',
1384 'contextlevel' => CONTEXT_COURSE,
31c93303 1385 'archetypes' => array(
dc558690 1386 'editingteacher' => CAP_ALLOW,
4f0c2d00 1387 'manager' => CAP_ALLOW
dc558690 1388 )
1389 ),
eef868d1 1390
3924b988 1391 'moodle/course:viewhiddensections' => array(
bcdb0f19 1392
3924b988 1393 'captype' => 'write',
1394 'contextlevel' => CONTEXT_COURSE,
31c93303 1395 'archetypes' => array(
3924b988 1396 'editingteacher' => CAP_ALLOW,
4f0c2d00 1397 'manager' => CAP_ALLOW
3924b988 1398 )
1399 ),
eef868d1 1400
3924b988 1401 'moodle/course:setcurrentsection' => array(
bcdb0f19 1402
3924b988 1403 'captype' => 'write',
1404 'contextlevel' => CONTEXT_COURSE,
31c93303 1405 'archetypes' => array(
3924b988 1406 'editingteacher' => CAP_ALLOW,
4f0c2d00 1407 'manager' => CAP_ALLOW
3924b988 1408 )
1409 ),
eef868d1 1410
dd45888a 1411 'moodle/site:mnetlogintoremote' => array(
bc4c9800 1412
3924b988 1413 'captype' => 'read',
dd45888a 1414 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1415 'archetypes' => array(
3924b988 1416 )
1417 ),
eef868d1 1418
dd45888a 1419 'moodle/grade:viewall' => array(
bcdb0f19 1420 'riskbitmask' => RISK_PERSONAL,
dd45888a 1421 'captype' => 'read',
eecf76df 1422 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_USER
31c93303 1423 'archetypes' => array(
dd45888a 1424 'teacher' => CAP_ALLOW,
3924b988 1425 'editingteacher' => CAP_ALLOW,
4f0c2d00 1426 'manager' => CAP_ALLOW
dd45888a 1427 ),
1428 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
f509ce06 1429 ),
f43ce1ad 1430
dd45888a 1431 'moodle/grade:view' => array(
f509ce06 1432 'captype' => 'read',
eecf76df 1433 'contextlevel' => CONTEXT_COURSE,
31c93303 1434 'archetypes' => array(
dd45888a 1435 'student' => CAP_ALLOW
f509ce06 1436 )
ca9ffa18 1437 ),
dd45888a 1438
1439 'moodle/grade:viewhidden' => array(
ca9ffa18 1440 'riskbitmask' => RISK_PERSONAL,
1441 'captype' => 'read',
eecf76df 1442 'contextlevel' => CONTEXT_COURSE,
31c93303 1443 'archetypes' => array(
0371f8e5 1444 'teacher' => CAP_ALLOW,
1445 'editingteacher' => CAP_ALLOW,
4f0c2d00 1446 'manager' => CAP_ALLOW
dd45888a 1447 ),
1448 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
ca9ffa18 1449 ),
dd45888a 1450
1451 'moodle/grade:import' => array(
3a0c6cca 1452 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
dd45888a 1453 'captype' => 'write',
ca9ffa18 1454 'contextlevel' => CONTEXT_COURSE,
31c93303 1455 'archetypes' => array(
ca9ffa18 1456 'editingteacher' => CAP_ALLOW,
4f0c2d00 1457 'manager' => CAP_ALLOW
dd45888a 1458 ),
1459 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1460 ),
dd45888a 1461
1462 'moodle/grade:export' => array(
ca9ffa18 1463 'riskbitmask' => RISK_PERSONAL,
1464 'captype' => 'read',
1465 'contextlevel' => CONTEXT_COURSE,
31c93303 1466 'archetypes' => array(
ca9ffa18 1467 'teacher' => CAP_ALLOW,
1468 'editingteacher' => CAP_ALLOW,
4f0c2d00 1469 'manager' => CAP_ALLOW
dd45888a 1470 ),
1471 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1472 ),
dd45888a 1473
1474 'moodle/grade:manage' => array(
3a0c6cca 1475 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
dd45888a 1476 'captype' => 'write',
1477 'contextlevel' => CONTEXT_COURSE,
31c93303 1478 'archetypes' => array(
dd45888a 1479 'editingteacher' => CAP_ALLOW,
4f0c2d00 1480 'manager' => CAP_ALLOW
dd45888a 1481 ),
1482 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1483 ),
dd45888a 1484
a5b8be62 1485 'moodle/grade:edit' => array(
1486 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
04259694 1487 'captype' => 'write',
1488 'contextlevel' => CONTEXT_COURSE,
31c93303 1489 'archetypes' => array(
04259694 1490 'editingteacher' => CAP_ALLOW,
4f0c2d00 1491 'manager' => CAP_ALLOW
04259694 1492 ),
1493 'clonepermissionsfrom' => 'moodle/course:managegrades'
1494 ),
1495
a5b8be62 1496 'moodle/grade:manageoutcomes' => array(
284abb09 1497 'captype' => 'write',
1498 'contextlevel' => CONTEXT_COURSE,
31c93303 1499 'archetypes' => array(
284abb09 1500 'editingteacher' => CAP_ALLOW,
4f0c2d00 1501 'manager' => CAP_ALLOW
284abb09 1502 ),
1503 'clonepermissionsfrom' => 'moodle/course:managegrades'
1504 ),
1505
1506 'moodle/grade:manageletters' => array(
ca9ffa18 1507 'captype' => 'write',
1508 'contextlevel' => CONTEXT_COURSE,
31c93303 1509 'archetypes' => array(
ca9ffa18 1510 'editingteacher' => CAP_ALLOW,
4f0c2d00 1511 'manager' => CAP_ALLOW
a5b8be62 1512 ),
1513 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1514 ),
dd45888a 1515
a5b8be62 1516 'moodle/grade:hide' => array(
ca9ffa18 1517 'captype' => 'write',
1518 'contextlevel' => CONTEXT_COURSE,
31c93303 1519 'archetypes' => array(
ca9ffa18 1520 'editingteacher' => CAP_ALLOW,
4f0c2d00 1521 'manager' => CAP_ALLOW
ca9ffa18 1522 )
1523 ),
dd45888a 1524
a5b8be62 1525 'moodle/grade:lock' => array(
dd45888a 1526 'captype' => 'write',
ca9ffa18 1527 'contextlevel' => CONTEXT_COURSE,
31c93303 1528 'archetypes' => array(
ca9ffa18 1529 'editingteacher' => CAP_ALLOW,
4f0c2d00 1530 'manager' => CAP_ALLOW
ca9ffa18 1531 )
1532 ),
dd45888a 1533
a5b8be62 1534 'moodle/grade:unlock' => array(
ca9ffa18 1535 'captype' => 'write',
1536 'contextlevel' => CONTEXT_COURSE,
31c93303 1537 'archetypes' => array(
ca9ffa18 1538 'editingteacher' => CAP_ALLOW,
4f0c2d00 1539 'manager' => CAP_ALLOW
ca9ffa18 1540 )
282c1695 1541 ),
dd45888a 1542
1543 'moodle/my:manageblocks' => array(
282c1695 1544 'captype' => 'write',
1545 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1546 'archetypes' => array(
282c1695 1547 'user' => CAP_ALLOW
1548 )
eca3af25 1549 ),
dd45888a 1550
eca3af25 1551 'moodle/notes:view' => array(
1552 'captype' => 'read',
f432bebf 1553 'contextlevel' => CONTEXT_COURSE,
31c93303 1554 'archetypes' => array(
eca3af25 1555 'teacher' => CAP_ALLOW,
1556 'editingteacher' => CAP_ALLOW,
4f0c2d00 1557 'manager' => CAP_ALLOW
eca3af25 1558 )
1559 ),
1560
1561 'moodle/notes:manage' => array(
3a0c6cca 1562 'riskbitmask' => RISK_SPAM,
1563
eca3af25 1564 'captype' => 'write',
f432bebf 1565 'contextlevel' => CONTEXT_COURSE,
31c93303 1566 'archetypes' => array(
eca3af25 1567 'teacher' => CAP_ALLOW,
1568 'editingteacher' => CAP_ALLOW,
4f0c2d00 1569 'manager' => CAP_ALLOW
eca3af25 1570 )
dd45888a 1571 ),
79642064 1572
1573 'moodle/tag:manage' => array(
3a0c6cca 1574 'riskbitmask' => RISK_SPAM,
1575
79642064 1576 'captype' => 'write',
1577 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1578 'archetypes' => array(
79642064 1579 'teacher' => CAP_ALLOW,
1580 'editingteacher' => CAP_ALLOW,
4f0c2d00 1581 'manager' => CAP_ALLOW
79642064 1582 )
705789bd 1583 ),
1584
1585 'moodle/tag:create' => array(
3a0c6cca 1586 'riskbitmask' => RISK_SPAM,
1587
705789bd 1588 'captype' => 'write',
1589 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1590 'archetypes' => array(
4f0c2d00 1591 'manager' => CAP_ALLOW,
0f07c40e 1592 'user' => CAP_ALLOW
705789bd 1593 )
1594 ),
a5b8be62 1595
705789bd 1596 'moodle/tag:edit' => array(
3a0c6cca 1597 'riskbitmask' => RISK_SPAM,
1598
705789bd 1599 'captype' => 'write',
1600 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1601 'archetypes' => array(
4f0c2d00 1602 'manager' => CAP_ALLOW,
3e6e529f 1603 'user' => CAP_ALLOW
98b5789d 1604 )
1605 ),
a5b8be62 1606
98b5789d 1607 'moodle/tag:editblocks' => array(
1608 'captype' => 'write',
1609 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1610 'archetypes' => array(
705789bd 1611 'teacher' => CAP_ALLOW,
1612 'editingteacher' => CAP_ALLOW,
4f0c2d00 1613 'manager' => CAP_ALLOW
705789bd 1614 )
7e874772 1615 ),
1616
1617 'moodle/block:view' => array(
1618 'captype' => 'read',
1619 'contextlevel' => CONTEXT_BLOCK,
31c93303 1620 'archetypes' => array(
7e874772 1621 'guest' => CAP_ALLOW,
25a7d980 1622 'user' => CAP_ALLOW,
1623 'student' => CAP_ALLOW,
1624 'teacher' => CAP_ALLOW,
1625 'editingteacher' => CAP_ALLOW,
1626 'coursecreator' => CAP_ALLOW
7e874772 1627 )
8512f577 1628 ),
1629
d14edf06 1630 'moodle/block:edit' => array(
1631 'riskbitmask' => RISK_SPAM | RISK_XSS,
1632
1633 'captype' => 'write',
1634 'contextlevel' => CONTEXT_BLOCK,
31c93303 1635 'archetypes' => array(
d14edf06 1636 'editingteacher' => CAP_ALLOW,
1637 'coursecreator' => CAP_ALLOW
1638 )
1639 ),
1640
8512f577 1641 'moodle/portfolio:export' => array(
1642 'captype' => 'read',
1643 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1644 'archetypes' => array(
8512f577 1645 'user' => CAP_ALLOW,
1646 'student' => CAP_ALLOW,
1647 'teacher' => CAP_ALLOW,
1648 'editingteacher' => CAP_ALLOW,
1649 'coursecreator' => CAP_ALLOW
1650 )
1bcb7eb5 1651 ),
1652 'moodle/comment:view' => array(
1653
1654 'captype' => 'read',
ad0ae261 1655 'contextlevel' => CONTEXT_COURSE,
31c93303 1656 'archetypes' => array(
1bcb7eb5 1657 'user' => CAP_ALLOW,
1658 'student' => CAP_ALLOW,
1659 'teacher' => CAP_ALLOW,
1660 'editingteacher' => CAP_ALLOW,
1661 'coursecreator' => CAP_ALLOW,
4f0c2d00 1662 'manager' => CAP_ALLOW
1bcb7eb5 1663 )
1664 ),
1665 'moodle/comment:post' => array(
1666
1667 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
1668 'captype' => 'write',
ad0ae261 1669 'contextlevel' => CONTEXT_COURSE,
31c93303 1670 'archetypes' => array(
1bcb7eb5 1671 'user' => CAP_ALLOW,
1672 'student' => CAP_ALLOW,
1673 'teacher' => CAP_ALLOW,
1674 'editingteacher' => CAP_ALLOW,
1675 'coursecreator' => CAP_ALLOW,
4f0c2d00 1676 'manager' => CAP_ALLOW
1bcb7eb5 1677 )
1678 ),
1679 'moodle/comment:delete' => array(
1680
1681 'riskbitmask' => RISK_DATALOSS,
1682 'captype' => 'write',
ad0ae261 1683 'contextlevel' => CONTEXT_COURSE,
31c93303 1684 'archetypes' => array(
1bcb7eb5 1685 'editingteacher' => CAP_ALLOW,
1686 'coursecreator' => CAP_ALLOW,
4f0c2d00 1687 'manager' => CAP_ALLOW
1bcb7eb5 1688 )
5eacbd4b 1689 ),
1690 'moodle/webservice:createtoken' => array(
1691
52dd27bf 1692 'riskbitmask' => RISK_CONFIG | RISK_DATALOSS | RISK_SPAM | RISK_PERSONAL | RISK_XSS,
5eacbd4b 1693 'captype' => 'write',
1694 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1695 'archetypes' => array(
4f0c2d00 1696 'manager' => CAP_ALLOW
5eacbd4b 1697 )
a09aeee4 1698 ),
19fae119 1699 'moodle/rating:view' => array(
ad0ae261 1700
a09aeee4 1701 'captype' => 'read',
ad0ae261 1702 'contextlevel' => CONTEXT_COURSE,
31c93303 1703 'archetypes' => array(
ad0ae261 1704 'user' => CAP_ALLOW,
e116a818
AD
1705 'student' => CAP_ALLOW,
1706 'teacher' => CAP_ALLOW,
1707 'editingteacher' => CAP_ALLOW,
4f0c2d00 1708 'manager' => CAP_ALLOW
a09aeee4
AD
1709 )
1710 ),
6595a568 1711 'moodle/rating:viewany' => array(
ad0ae261 1712
6595a568
MD
1713 'riskbitmask' => RISK_PERSONAL,
1714 'captype' => 'read',
ad0ae261 1715 'contextlevel' => CONTEXT_COURSE,
31c93303 1716 'archetypes' => array(
ad0ae261 1717 'user' => CAP_ALLOW,
6595a568
MD
1718 'student' => CAP_ALLOW,
1719 'teacher' => CAP_ALLOW,
1720 'editingteacher' => CAP_ALLOW,
1721 'manager' => CAP_ALLOW
1722 )
1723 ),
19fae119 1724 'moodle/rating:viewall' => array(
ad0ae261 1725
a09aeee4
AD
1726 'riskbitmask' => RISK_PERSONAL,
1727 'captype' => 'read',
ad0ae261 1728 'contextlevel' => CONTEXT_COURSE,
31c93303 1729 'archetypes' => array(
ad0ae261 1730 'user' => CAP_ALLOW,
6595a568 1731 'student' => CAP_ALLOW,
e116a818
AD
1732 'teacher' => CAP_ALLOW,
1733 'editingteacher' => CAP_ALLOW,
4f0c2d00 1734 'manager' => CAP_ALLOW
a09aeee4
AD
1735 )
1736 ),
19fae119 1737 'moodle/rating:rate' => array(
ad0ae261 1738
a09aeee4 1739 'captype' => 'write',
ad0ae261 1740 'contextlevel' => CONTEXT_COURSE,
31c93303 1741 'archetypes' => array(
ad0ae261 1742 'user' => CAP_ALLOW,
6595a568 1743 'student' => CAP_ALLOW,
e116a818
AD
1744 'teacher' => CAP_ALLOW,
1745 'editingteacher' => CAP_ALLOW,
4f0c2d00 1746 'manager' => CAP_ALLOW
a09aeee4 1747 )
07ab0c80 1748 ),
1749 'moodle/course:publish' => array(
1750
07ab0c80 1751 'captype' => 'write',
ad0ae261 1752 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
07ab0c80 1753 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1754 'archetypes' => array(
07ab0c80 1755 'manager' => CAP_ALLOW
1756 )
2be4d090
MD
1757 ),
1758 'moodle/course:markcomplete' => array(
1759 'captype' => 'write',
1760 'contextlevel' => CONTEXT_COURSE,
31c93303 1761 'archetypes' => array(
2be4d090
MD
1762 'teacher' => CAP_ALLOW,
1763 'editingteacher' => CAP_ALLOW,
1764 'coursecreator' => CAP_ALLOW,
1765 'manager' => CAP_ALLOW
1766 )
755f96f8 1767 ),
1768 'moodle/community:add' => array(
1769 'captype' => 'write',
1770 'contextlevel' => CONTEXT_SYSTEM,
1771 'archetypes' => array(
1772 'manager' => CAP_ALLOW,
1773 'teacher' => CAP_ALLOW,
17957b8f 1774 'editingteacher' => CAP_ALLOW,
755f96f8 1775 'coursecreator' => CAP_ALLOW
1776 )
1777 ),
1778 'moodle/community:download' => array(
1779 'captype' => 'write',
1780 'contextlevel' => CONTEXT_SYSTEM,
1781 'archetypes' => array(
1782 'manager' => CAP_ALLOW,
17957b8f 1783 'editingteacher' => CAP_ALLOW,
755f96f8 1784 'coursecreator' => CAP_ALLOW
1785 )
79642064 1786 )
bbbf2d40 1787);