MDL-11267 - Anywone who can view quiz reports can delete student attempts. Merged...
[moodle.git] / lib / db / access.php
CommitLineData
bbbf2d40 1<?php
2//
3// Capability definitions for Moodle core.
4//
5// The capabilities are loaded into the database table when the module is
6// installed or updated. Whenever the capability definitions are updated,
7// the module version number should be bumped up.
8//
9// The system has four possible values for a capability:
10// CAP_ALLOW, CAP_PREVENT, CAP_PROHIBIT, and inherit (not set).
11//
12//
13// CAPABILITY NAMING CONVENTION
14//
15// It is important that capability names are unique. The naming convention
16// for capabilities that are specific to modules and blocks is as follows:
17// [mod/block]/<component_name>:<capabilityname>
18//
19// component_name should be the same as the directory name of the mod or block.
20//
21// Core moodle capabilities are defined thus:
22// moodle/<capabilityclass>:<capabilityname>
23//
24// Examples: mod/forum:viewpost
25// block/recent_activity:view
26// moodle/site:deleteuser
27//
28// The variable name for the capability definitions array follows the format
29// $<componenttype>_<component_name>_capabilities
30//
31// For the core capabilities, the variable is $moodle_capabilities.
32
33
34$moodle_capabilities = array(
eef868d1 35
bbbf2d40 36 'moodle/site:doanything' => array(
bcdb0f19 37
a6b02b65 38 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
bcdb0f19 39
bbbf2d40 40 'captype' => 'admin',
41 'contextlevel' => CONTEXT_SYSTEM
42 ),
eef868d1 43
bbbf2d40 44 'moodle/legacy:guest' => array(
bcdb0f19 45
bbbf2d40 46 'captype' => 'legacy',
47 'contextlevel' => CONTEXT_SYSTEM
48 ),
eef868d1 49
c785d40a 50 'moodle/legacy:user' => array(
51
52 'captype' => 'legacy',
53 'contextlevel' => CONTEXT_SYSTEM
54 ),
eef868d1 55
bbbf2d40 56 'moodle/legacy:student' => array(
bcdb0f19 57
21b6db6e 58 'riskbitmask' => RISK_SPAM,
bcdb0f19 59
bbbf2d40 60 'captype' => 'legacy',
61 'contextlevel' => CONTEXT_SYSTEM
62 ),
eef868d1 63
64
bbbf2d40 65 'moodle/legacy:teacher' => array(
bcdb0f19 66
21b6db6e 67 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
bcdb0f19 68
bbbf2d40 69 'captype' => 'legacy',
70 'contextlevel' => CONTEXT_SYSTEM
71 ),
eef868d1 72
73
bbbf2d40 74 'moodle/legacy:editingteacher' => array(
bcdb0f19 75
21b6db6e 76 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
bcdb0f19 77
bbbf2d40 78 'captype' => 'legacy',
79 'contextlevel' => CONTEXT_SYSTEM
80 ),
eef868d1 81
82
bbbf2d40 83 'moodle/legacy:coursecreator' => array(
bcdb0f19 84
21b6db6e 85 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
bcdb0f19 86
bbbf2d40 87 'captype' => 'legacy',
88 'contextlevel' => CONTEXT_SYSTEM
89 ),
eef868d1 90
91
bbbf2d40 92 'moodle/legacy:admin' => array(
bcdb0f19 93
a6b02b65 94 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
bcdb0f19 95
bbbf2d40 96 'captype' => 'legacy',
97 'contextlevel' => CONTEXT_SYSTEM
98 ),
eef868d1 99
100
bbbf2d40 101 'moodle/site:config' => array(
eef868d1 102
a6b02b65 103 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
21b6db6e 104
bbbf2d40 105 'captype' => 'write',
106 'contextlevel' => CONTEXT_SYSTEM,
107 'legacy' => array(
bbbf2d40 108 'admin' => CAP_ALLOW
109 )
110 ),
eef868d1 111
51792df0 112 'moodle/site:readallmessages' => array(
eef868d1 113
bcdb0f19 114 'riskbitmask' => RISK_PERSONAL,
115
51792df0 116 'captype' => 'read',
117 'contextlevel' => CONTEXT_SYSTEM,
118 'legacy' => array(
4b7ae3c4 119 'admin' => CAP_ALLOW,
120 'editingteacher' => CAP_ALLOW
51792df0 121 )
122 ),
eef868d1 123
51792df0 124 'moodle/site:approvecourse' => array(
eef868d1 125
bcdb0f19 126 'riskbitmask' => RISK_XSS,
127
51792df0 128 'captype' => 'write',
129 'contextlevel' => CONTEXT_SYSTEM,
130 'legacy' => array(
51792df0 131 'admin' => CAP_ALLOW
132 )
133 ),
eef868d1 134
bbbf2d40 135 'moodle/site:import' => array(
eef868d1 136
21b6db6e 137 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
138
bbbf2d40 139 'captype' => 'write',
140 'contextlevel' => CONTEXT_SYSTEM,
141 'legacy' => array(
a028c291 142 'editingteacher' => CAP_ALLOW,
bbbf2d40 143 'admin' => CAP_ALLOW
144 )
145 ),
eef868d1 146
bbbf2d40 147 'moodle/site:backup' => array(
eef868d1 148
21b6db6e 149 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
150
bbbf2d40 151 'captype' => 'write',
152 'contextlevel' => CONTEXT_SYSTEM,
153 'legacy' => array(
7246585a 154 'editingteacher' => CAP_ALLOW,
bbbf2d40 155 'admin' => CAP_ALLOW
156 )
157 ),
eef868d1 158
bbbf2d40 159 'moodle/site:restore' => array(
eef868d1 160
21b6db6e 161 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
162
bbbf2d40 163 'captype' => 'write',
164 'contextlevel' => CONTEXT_SYSTEM,
165 'legacy' => array(
7246585a 166 'editingteacher' => CAP_ALLOW,
bbbf2d40 167 'admin' => CAP_ALLOW
168 )
169 ),
eef868d1 170
bbbf2d40 171 'moodle/site:manageblocks' => array(
eef868d1 172
21b6db6e 173 'riskbitmask' => RISK_SPAM | RISK_XSS,
174
bbbf2d40 175 'captype' => 'write',
176 'contextlevel' => CONTEXT_SYSTEM,
177 'legacy' => array(
73b73d21 178 'editingteacher' => CAP_ALLOW,
bbbf2d40 179 'admin' => CAP_ALLOW
180 )
181 ),
eef868d1 182
27950688 183 'moodle/site:accessallgroups' => array(
eef868d1 184
27950688 185 'captype' => 'read',
186 'contextlevel' => CONTEXT_SYSTEM,
187 'legacy' => array(
27950688 188 'teacher' => CAP_ALLOW,
189 'editingteacher' => CAP_ALLOW,
27950688 190 'admin' => CAP_ALLOW
191 )
192 ),
eef868d1 193
53d7785b 194 'moodle/site:viewfullnames' => array(
eef868d1 195
53d7785b 196 'captype' => 'read',
197 'contextlevel' => CONTEXT_SYSTEM,
198 'legacy' => array(
53d7785b 199 'teacher' => CAP_ALLOW,
200 'editingteacher' => CAP_ALLOW,
53d7785b 201 'admin' => CAP_ALLOW
202 )
203 ),
eef868d1 204
a028c291 205 'moodle/site:viewreports' => array(
eef868d1 206
21b6db6e 207 'riskbitmask' => RISK_PERSONAL,
208
a028c291 209 'captype' => 'read',
77d4953e 210 'contextlevel' => CONTEXT_SYSTEM,
a028c291 211 'legacy' => array(
a028c291 212 'teacher' => CAP_ALLOW,
213 'editingteacher' => CAP_ALLOW,
a028c291 214 'admin' => CAP_ALLOW
215 )
216 ),
eef868d1 217
7d8a3cb0 218 'moodle/site:trustcontent' => array(
eef868d1 219
21b6db6e 220 'riskbitmask' => RISK_XSS,
221
7d8a3cb0 222 'captype' => 'write',
223 'contextlevel' => CONTEXT_SYSTEM,
224 'legacy' => array(
7d8a3cb0 225 'editingteacher' => CAP_ALLOW,
7d8a3cb0 226 'admin' => CAP_ALLOW
227 )
228 ),
eef868d1 229
6df3c7df 230 'moodle/site:uploadusers' => array(
eef868d1 231
21b6db6e 232 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
233
bbbf2d40 234 'captype' => 'write',
235 'contextlevel' => CONTEXT_SYSTEM,
236 'legacy' => array(
bbbf2d40 237 'admin' => CAP_ALLOW
238 )
239 ),
eef868d1 240
2a55410b 241 'moodle/site:langeditmaster' => array(
242
243 'riskbitmask' => RISK_CONFIG | RISK_XSS,
244
245 'captype' => 'write',
246 'contextlevel' => CONTEXT_SYSTEM,
247 'legacy' => array(
248 'admin' => CAP_PREVENT
249 )
250 ),
251
252 'moodle/site:langeditlocal' => array(
253
254 'riskbitmask' => RISK_CONFIG | RISK_XSS,
255
256 'captype' => 'write',
257 'contextlevel' => CONTEXT_SYSTEM,
258 'legacy' => array(
259 'admin' => CAP_ALLOW
260 )
261 ),
262
6df3c7df 263
264 'moodle/user:create' => array(
265
266 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
eef868d1 267
bbbf2d40 268 'captype' => 'write',
269 'contextlevel' => CONTEXT_SYSTEM,
270 'legacy' => array(
bbbf2d40 271 'admin' => CAP_ALLOW
272 )
273 ),
eef868d1 274
6df3c7df 275 'moodle/user:delete' => array(
cc891abe 276
bcdb0f19 277 'riskbitmask' => RISK_PERSONAL,
278
cc891abe 279 'captype' => 'write',
280 'contextlevel' => CONTEXT_SYSTEM,
281 'legacy' => array(
cc891abe 282 'admin' => CAP_ALLOW
283 )
284 ),
285
6df3c7df 286 'moodle/user:update' => array(
cc891abe 287
288 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
21b6db6e 289
bbbf2d40 290 'captype' => 'write',
291 'contextlevel' => CONTEXT_SYSTEM,
292 'legacy' => array(
bbbf2d40 293 'admin' => CAP_ALLOW
294 )
295 ),
eef868d1 296
bbbf2d40 297 'moodle/user:viewdetails' => array(
eef868d1 298
e58eca72 299 'captype' => 'read',
bbbf2d40 300 'contextlevel' => CONTEXT_SYSTEM,
301 'legacy' => array(
22ae509e 302 'guest' => CAP_ALLOW,
303 'student' => CAP_ALLOW,
304 'teacher' => CAP_ALLOW,
305 'editingteacher' => CAP_ALLOW,
bbbf2d40 306 'admin' => CAP_ALLOW
307 )
308 ),
e58eca72 309
310 'moodle/user:viewhiddendetails' => array(
eef868d1 311
21b6db6e 312 'riskbitmask' => RISK_PERSONAL,
313
e58eca72 314 'captype' => 'read',
315 'contextlevel' => CONTEXT_SYSTEM,
316 'legacy' => array(
e58eca72 317 'teacher' => CAP_ALLOW,
318 'editingteacher' => CAP_ALLOW,
e58eca72 319 'admin' => CAP_ALLOW
320 )
321 ),
eef868d1 322
6c95827f 323 'moodle/user:loginas' => array(
324
325 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
326
327 'captype' => 'write',
328 'contextlevel' => CONTEXT_COURSE,
329 'legacy' => array(
6c95827f 330 'admin' => CAP_ALLOW
331 )
332 ),
333
bbbf2d40 334 'moodle/role:assign' => array(
eef868d1 335
bbbf2d40 336 'captype' => 'write',
337 'contextlevel' => CONTEXT_SYSTEM,
338 'legacy' => array(
861fdcaa 339 'editingteacher' => CAP_ALLOW,
68c52526 340 'admin' => CAP_ALLOW
341 )
342 ),
eef868d1 343
68c52526 344 'moodle/role:override' => array(
eef868d1 345
bcdb0f19 346 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
347
68c52526 348 'captype' => 'write',
349 'contextlevel' => CONTEXT_SYSTEM,
350 'legacy' => array(
bbbf2d40 351 'admin' => CAP_ALLOW
352 )
353 ),
eef868d1 354
bbbf2d40 355 'moodle/role:manage' => array(
eef868d1 356
bcdb0f19 357 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
358
bbbf2d40 359 'captype' => 'write',
360 'contextlevel' => CONTEXT_SYSTEM,
361 'legacy' => array(
bbbf2d40 362 'admin' => CAP_ALLOW
363 )
364 ),
f43ce1ad 365
366 'moodle/role:unassignself' => array(
bcdb0f19 367
f43ce1ad 368 'captype' => 'write',
369 'contextlevel' => CONTEXT_SYSTEM,
370 'legacy' => array(
2d5a4f25 371 'student' => (empty($CFG->allowunenrol)) ? CAP_INHERIT : CAP_ALLOW,
f43ce1ad 372 'teacher' => CAP_ALLOW,
373 'editingteacher' => CAP_ALLOW,
374 'coursecreator' => CAP_ALLOW,
375 'admin' => CAP_ALLOW
376 )
377 ),
99f9cb51 378
379 'moodle/role:viewhiddenassigns' => array(
bcdb0f19 380
99f9cb51 381 'captype' => 'read',
382 'contextlevel' => CONTEXT_SYSTEM,
383 'legacy' => array(
99f9cb51 384 'teacher' => CAP_ALLOW,
385 'editingteacher' => CAP_ALLOW,
99f9cb51 386 'admin' => CAP_ALLOW
387 )
388 ),
eef868d1 389
20dd4cf5 390 'moodle/role:switchroles' => array(
bcdb0f19 391
20dd4cf5 392 'riskbitmask' => RISK_XSS,
bcdb0f19 393
20dd4cf5 394 'captype' => 'read',
395 'contextlevel' => CONTEXT_SYSTEM,
396 'legacy' => array(
20dd4cf5 397 'editingteacher' => CAP_ALLOW,
20dd4cf5 398 'admin' => CAP_ALLOW
399 )
400 ),
401
bbbf2d40 402 'moodle/category:create' => array(
eef868d1 403
89a792ab 404 'riskbitmask' => RISK_XSS,
405
bbbf2d40 406 'captype' => 'write',
407 'contextlevel' => CONTEXT_COURSECAT,
408 'legacy' => array(
bbbf2d40 409 'admin' => CAP_ALLOW
410 )
411 ),
eef868d1 412
bbbf2d40 413 'moodle/category:delete' => array(
eef868d1 414
bbbf2d40 415 'captype' => 'write',
416 'contextlevel' => CONTEXT_COURSECAT,
417 'legacy' => array(
bbbf2d40 418 'admin' => CAP_ALLOW
419 )
420 ),
eef868d1 421
bbbf2d40 422 'moodle/category:update' => array(
eef868d1 423
89a792ab 424 'riskbitmask' => RISK_XSS,
425
bbbf2d40 426 'captype' => 'write',
427 'contextlevel' => CONTEXT_COURSECAT,
428 'legacy' => array(
bbbf2d40 429 'admin' => CAP_ALLOW
430 )
431 ),
eef868d1 432
bbbf2d40 433 'moodle/category:visibility' => array(
eef868d1 434
bbbf2d40 435 'captype' => 'write',
436 'contextlevel' => CONTEXT_COURSECAT,
437 'legacy' => array(
bbbf2d40 438 'admin' => CAP_ALLOW
439 )
440 ),
eef868d1 441
bbbf2d40 442 'moodle/course:create' => array(
eef868d1 443
21b6db6e 444 'riskbitmask' => RISK_XSS,
445
bbbf2d40 446 'captype' => 'write',
5e992f56 447 'contextlevel' => CONTEXT_COURSECAT,
bbbf2d40 448 'legacy' => array(
4473252d 449 'coursecreator' => CAP_ALLOW,
bbbf2d40 450 'admin' => CAP_ALLOW
451 )
452 ),
eef868d1 453
bbbf2d40 454 'moodle/course:delete' => array(
eef868d1 455
bbbf2d40 456 'captype' => 'write',
457 'contextlevel' => CONTEXT_COURSE,
458 'legacy' => array(
bbbf2d40 459 'admin' => CAP_ALLOW
460 )
461 ),
eef868d1 462
bbbf2d40 463 'moodle/course:update' => array(
eef868d1 464
21b6db6e 465 'riskbitmask' => RISK_XSS,
466
bbbf2d40 467 'captype' => 'write',
468 'contextlevel' => CONTEXT_COURSE,
469 'legacy' => array(
bbbf2d40 470 'editingteacher' => CAP_ALLOW,
bbbf2d40 471 'admin' => CAP_ALLOW
472 )
473 ),
eef868d1 474
bbbf2d40 475 'moodle/course:view' => array(
eef868d1 476
bbbf2d40 477 'captype' => 'read',
478 'contextlevel' => CONTEXT_COURSE,
479 'legacy' => array(
b0f55230 480 'guest' => CAP_ALLOW,
bbbf2d40 481 'student' => CAP_ALLOW,
482 'teacher' => CAP_ALLOW,
72cf2e39 483 'editingteacher' => CAP_ALLOW
bbbf2d40 484 )
485 ),
eef868d1 486
77c645df 487 'moodle/course:bulkmessaging' => array(
488
489 'riskbitmask' => RISK_SPAM,
490
491 'captype' => 'write',
492 'contextlevel' => CONTEXT_COURSE,
493 'legacy' => array(
77c645df 494 'teacher' => CAP_ALLOW,
495 'editingteacher' => CAP_ALLOW,
77c645df 496 'admin' => CAP_ALLOW
497 )
498 ),
499
1c45e42e 500 'moodle/course:viewhiddenuserfields' => array(
eef868d1 501
21b6db6e 502 'riskbitmask' => RISK_PERSONAL,
503
1c45e42e 504 'captype' => 'read',
505 'contextlevel' => CONTEXT_COURSE,
506 'legacy' => array(
1c45e42e 507 'teacher' => CAP_ALLOW,
508 'editingteacher' => CAP_ALLOW,
1c45e42e 509 'admin' => CAP_ALLOW
510 )
511 ),
eef868d1 512
1c45e42e 513 'moodle/course:viewhiddencourses' => array(
eef868d1 514
1c45e42e 515 'captype' => 'read',
516 'contextlevel' => CONTEXT_COURSE,
517 'legacy' => array(
2f5ab42b 518 'coursecreator' => CAP_ALLOW,
519 'teacher' => CAP_ALLOW,
520 'editingteacher' => CAP_ALLOW,
521 'admin' => CAP_ALLOW
1c45e42e 522 )
523 ),
eef868d1 524
bbbf2d40 525 'moodle/course:visibility' => array(
eef868d1 526
bbbf2d40 527 'captype' => 'write',
528 'contextlevel' => CONTEXT_COURSE,
529 'legacy' => array(
bbbf2d40 530 'admin' => CAP_ALLOW
531 )
532 ),
eef868d1 533
a028c291 534 'moodle/course:managefiles' => array(
eef868d1 535
21b6db6e 536 'riskbitmask' => RISK_XSS,
537
a028c291 538 'captype' => 'write',
539 'contextlevel' => CONTEXT_COURSE,
540 'legacy' => array(
a028c291 541 'editingteacher' => CAP_ALLOW,
a028c291 542 'admin' => CAP_ALLOW
543 )
544 ),
eef868d1 545
bbbf2d40 546 'moodle/course:manageactivities' => array(
eef868d1 547
21b6db6e 548 'riskbitmask' => RISK_XSS,
549
bbbf2d40 550 'captype' => 'write',
551 'contextlevel' => CONTEXT_COURSE,
552 'legacy' => array(
bbbf2d40 553 'editingteacher' => CAP_ALLOW,
bbbf2d40 554 'admin' => CAP_ALLOW
555 )
556 ),
eef868d1 557
b79da3ac 558 'moodle/course:managemetacourse' => array(
eef868d1 559
4b7aaf40 560 'captype' => 'write',
561 'contextlevel' => CONTEXT_COURSE,
562 'legacy' => array(
4b7aaf40 563 'editingteacher' => CAP_ALLOW,
4b7aaf40 564 'admin' => CAP_ALLOW
565 )
566 ),
eef868d1 567
bbbf2d40 568 'moodle/course:activityvisibility' => array(
eef868d1 569
bbbf2d40 570 'captype' => 'write',
571 'contextlevel' => CONTEXT_COURSE,
572 'legacy' => array(
bbbf2d40 573 'editingteacher' => CAP_ALLOW,
bbbf2d40 574 'admin' => CAP_ALLOW
575 )
576 ),
eef868d1 577
bbbf2d40 578 'moodle/course:viewhiddenactivities' => array(
eef868d1 579
bbbf2d40 580 'captype' => 'write',
581 'contextlevel' => CONTEXT_COURSE,
582 'legacy' => array(
bbbf2d40 583 'teacher' => CAP_ALLOW,
584 'editingteacher' => CAP_ALLOW,
bbbf2d40 585 'admin' => CAP_ALLOW
586 )
587 ),
eef868d1 588
bbbf2d40 589 'moodle/course:viewparticipants' => array(
eef868d1 590
bbbf2d40 591 'captype' => 'read',
592 'contextlevel' => CONTEXT_COURSE,
593 'legacy' => array(
bbbf2d40 594 'student' => CAP_ALLOW,
595 'teacher' => CAP_ALLOW,
596 'editingteacher' => CAP_ALLOW,
bbbf2d40 597 'admin' => CAP_ALLOW
598 )
599 ),
eef868d1 600
bbbf2d40 601 'moodle/course:viewscales' => array(
eef868d1 602
bbbf2d40 603 'captype' => 'read',
604 'contextlevel' => CONTEXT_COURSE,
605 'legacy' => array(
bbbf2d40 606 'student' => CAP_ALLOW,
607 'teacher' => CAP_ALLOW,
608 'editingteacher' => CAP_ALLOW,
bbbf2d40 609 'admin' => CAP_ALLOW
610 )
611 ),
eef868d1 612
bbbf2d40 613 'moodle/course:managescales' => array(
eef868d1 614
bbbf2d40 615 'captype' => 'write',
616 'contextlevel' => CONTEXT_COURSE,
617 'legacy' => array(
bbbf2d40 618 'editingteacher' => CAP_ALLOW,
bbbf2d40 619 'admin' => CAP_ALLOW
620 )
621 ),
eef868d1 622
bbbf2d40 623 'moodle/course:managegroups' => array(
624
625 'captype' => 'write',
626 'contextlevel' => CONTEXT_COURSE,
a028c291 627 'legacy' => array(
a028c291 628 'editingteacher' => CAP_ALLOW,
a028c291 629 'admin' => CAP_ALLOW
630 )
631 ),
eef868d1 632
a028c291 633 'moodle/course:reset' => array(
634
635 'captype' => 'write',
636 'contextlevel' => CONTEXT_COURSE,
bbbf2d40 637 'legacy' => array(
bbbf2d40 638 'editingteacher' => CAP_ALLOW,
bbbf2d40 639 'admin' => CAP_ALLOW
640 )
641 ),
eef868d1 642
bbbf2d40 643 'moodle/blog:view' => array(
644
645 'captype' => 'read',
646 'contextlevel' => CONTEXT_SYSTEM,
647 'legacy' => array(
00adf177 648 'guest' => CAP_ALLOW,
c785d40a 649 'user' => CAP_ALLOW,
bbbf2d40 650 'student' => CAP_ALLOW,
651 'teacher' => CAP_ALLOW,
652 'editingteacher' => CAP_ALLOW,
bbbf2d40 653 'admin' => CAP_ALLOW
654 )
655 ),
eef868d1 656
5a8ab2e9 657 'moodle/blog:create' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 658
21b6db6e 659 'riskbitmask' => RISK_SPAM,
660
bbbf2d40 661 'captype' => 'write',
662 'contextlevel' => CONTEXT_SYSTEM,
663 'legacy' => array(
c785d40a 664 'user' => CAP_ALLOW,
bbbf2d40 665 'admin' => CAP_ALLOW
666 )
667 ),
eef868d1 668
bbbf2d40 669 'moodle/blog:manageofficialtags' => array(
670
21b6db6e 671 'riskbitmask' => RISK_SPAM,
672
bbbf2d40 673 'captype' => 'write',
674 'contextlevel' => CONTEXT_SYSTEM,
675 'legacy' => array(
bbbf2d40 676 'admin' => CAP_ALLOW
677 )
678 ),
eef868d1 679
bbbf2d40 680 'moodle/blog:managepersonaltags' => array(
681
21b6db6e 682 'riskbitmask' => RISK_SPAM,
683
bbbf2d40 684 'captype' => 'write',
685 'contextlevel' => CONTEXT_SYSTEM,
686 'legacy' => array(
bbbf2d40 687 'student' => CAP_ALLOW,
688 'teacher' => CAP_ALLOW,
689 'editingteacher' => CAP_ALLOW,
bbbf2d40 690 'admin' => CAP_ALLOW
691 )
692 ),
eef868d1 693
bbbf2d40 694 'moodle/blog:manageentries' => array(
695
21b6db6e 696 'riskbitmask' => RISK_SPAM,
697
bbbf2d40 698 'captype' => 'write',
699 'contextlevel' => CONTEXT_SYSTEM,
700 'legacy' => array(
bbbf2d40 701 'teacher' => CAP_ALLOW,
702 'editingteacher' => CAP_ALLOW,
bbbf2d40 703 'admin' => CAP_ALLOW
704 )
705 ),
eef868d1 706
5a8ab2e9 707 'moodle/calendar:manageownentries' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 708
21b6db6e 709 'riskbitmask' => RISK_SPAM,
710
bbbf2d40 711 'captype' => 'write',
712 'contextlevel' => CONTEXT_SYSTEM,
713 'legacy' => array(
c785d40a 714 'user' => CAP_ALLOW,
bbbf2d40 715 'admin' => CAP_ALLOW
716 )
717 ),
eef868d1 718
bbbf2d40 719 'moodle/calendar:manageentries' => array(
720
21b6db6e 721 'riskbitmask' => RISK_SPAM,
722
bbbf2d40 723 'captype' => 'write',
724 'contextlevel' => CONTEXT_SYSTEM,
725 'legacy' => array(
bbbf2d40 726 'teacher' => CAP_ALLOW,
727 'editingteacher' => CAP_ALLOW,
bbbf2d40 728 'admin' => CAP_ALLOW
729 )
77d4953e 730 ),
a044c05d 731
732 'moodle/user:editprofile' => array(
733
734 'riskbitmask' => RISK_SPAM,
735
736 'captype' => 'write',
737 'contextlevel' => CONTEXT_USER,
738 'legacy' => array(
739 'admin' => CAP_ALLOW
740 )
741 ),
eef868d1 742
1cb3da36 743 'moodle/user:editownprofile' => array(
744
745 'captype' => 'write',
746 'contextlevel' => CONTEXT_SYSTEM,
747 'legacy' => array(
748 'guest' => CAP_PROHIBIT,
749 'user' => CAP_ALLOW,
750 'admin' => CAP_ALLOW
751 )
752 ),
753
754 'moodle/user:changeownpassword' => array(
755
756 'captype' => 'write',
757 'contextlevel' => CONTEXT_SYSTEM,
758 'legacy' => array(
759 'guest' => CAP_PROHIBIT,
760 'user' => CAP_ALLOW,
761 'admin' => CAP_ALLOW
762 )
763 ),
764
eef868d1 765 // The next 3 might make no sense for some roles, e.g teacher, etc.
77d4953e 766 // since the next level up is site. These are more for the parent role
767 'moodle/user:readuserposts' => array(
bcdb0f19 768
77d4953e 769 'captype' => 'read',
4b10f08b 770 'contextlevel' => CONTEXT_USER,
77d4953e 771 'legacy' => array(
77d4953e 772 'student' => CAP_ALLOW,
773 'teacher' => CAP_ALLOW,
774 'editingteacher' => CAP_ALLOW,
77d4953e 775 'admin' => CAP_ALLOW
776 )
777 ),
eef868d1 778
77d4953e 779 'moodle/user:readuserblogs' => array(
bcdb0f19 780
77d4953e 781 'captype' => 'read',
4b10f08b 782 'contextlevel' => CONTEXT_USER,
77d4953e 783 'legacy' => array(
77d4953e 784 'student' => CAP_ALLOW,
785 'teacher' => CAP_ALLOW,
786 'editingteacher' => CAP_ALLOW,
77d4953e 787 'admin' => CAP_ALLOW
788 )
789 ),
eef868d1 790
77d4953e 791 'moodle/user:viewuseractivitiesreport' => array(
bcdb0f19 792
77d4953e 793 'captype' => 'read',
4b10f08b 794 'contextlevel' => CONTEXT_USER,
77d4953e 795 'legacy' => array(
77d4953e 796 'teacher' => CAP_ALLOW,
797 'editingteacher' => CAP_ALLOW,
77d4953e 798 'admin' => CAP_ALLOW
799 )
945f88ca 800 ),
eef868d1 801
271e6dec 802 'moodle/question:managecategory' => array(
21b6db6e 803
945f88ca 804 'captype' => 'write',
805 'contextlevel' => CONTEXT_COURSE,
806 'legacy' => array(
945f88ca 807 'editingteacher' => CAP_ALLOW,
945f88ca 808 'admin' => CAP_ALLOW
809 )
271e6dec 810 ),
811
812 //new in moodle 1.9
813 'moodle/question:add' => array(
814 'riskbitmask' => RISK_SPAM,
815 'captype' => 'write',
816 'contextlevel' => CONTEXT_COURSE,
817 'legacy' => array(
818 'editingteacher' => CAP_ALLOW,
819 'admin' => CAP_ALLOW
820 ),
821 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 822 ),
271e6dec 823 'moodle/question:editmine' => array(
824 'riskbitmask' => RISK_SPAM,
825 'captype' => 'write',
826 'contextlevel' => CONTEXT_COURSE,
827 'legacy' => array(
828 'editingteacher' => CAP_ALLOW,
829 'admin' => CAP_ALLOW
830 ),
831 'clonepermissionsfrom' => 'moodle/question:manage'
832 ),
833 'moodle/question:editall' => array(
834 'riskbitmask' => RISK_SPAM,
835 'captype' => 'write',
836 'contextlevel' => CONTEXT_COURSE,
837 'legacy' => array(
838 'editingteacher' => CAP_ALLOW,
839 'admin' => CAP_ALLOW
840 ),
841 'clonepermissionsfrom' => 'moodle/question:manage'
842 ),
843 'moodle/question:viewmine' => array(
945f88ca 844 'captype' => 'read',
845 'contextlevel' => CONTEXT_COURSE,
846 'legacy' => array(
945f88ca 847 'editingteacher' => CAP_ALLOW,
945f88ca 848 'admin' => CAP_ALLOW
271e6dec 849 ),
850 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 851 ),
271e6dec 852 'moodle/question:viewall' => array(
853 'captype' => 'read',
854 'contextlevel' => CONTEXT_COURSE,
855 'legacy' => array(
856 'editingteacher' => CAP_ALLOW,
857 'admin' => CAP_ALLOW
858 ),
859 'clonepermissionsfrom' => 'moodle/question:manage'
860 ),
861 'moodle/question:usemine' => array(
862 'captype' => 'read',
863 'contextlevel' => CONTEXT_COURSE,
864 'legacy' => array(
865 'editingteacher' => CAP_ALLOW,
866 'admin' => CAP_ALLOW
867 ),
868 'clonepermissionsfrom' => 'moodle/question:manage'
869 ),
870 'moodle/question:useall' => array(
871 'captype' => 'read',
872 'contextlevel' => CONTEXT_COURSE,
873 'legacy' => array(
874 'editingteacher' => CAP_ALLOW,
875 'admin' => CAP_ALLOW
876 ),
877 'clonepermissionsfrom' => 'moodle/question:manage'
878 ),
879 'moodle/question:movemine' => array(
945f88ca 880 'captype' => 'write',
881 'contextlevel' => CONTEXT_COURSE,
882 'legacy' => array(
945f88ca 883 'editingteacher' => CAP_ALLOW,
945f88ca 884 'admin' => CAP_ALLOW
271e6dec 885 ),
886 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 887 ),
271e6dec 888 'moodle/question:moveall' => array(
945f88ca 889 'captype' => 'write',
890 'contextlevel' => CONTEXT_COURSE,
891 'legacy' => array(
945f88ca 892 'editingteacher' => CAP_ALLOW,
945f88ca 893 'admin' => CAP_ALLOW
271e6dec 894 ),
895 'clonepermissionsfrom' => 'moodle/question:manage'
7191a1fa 896 ),
271e6dec 897 //END new in moodle 1.9
898
0eb6b04a 899 // Configure the installed question types.
900 'moodle/question:config' => array(
901
902 'riskbitmask' => RISK_CONFIG,
903
904 'captype' => 'write',
905 'contextlevel' => CONTEXT_SYSTEM,
906 'legacy' => array(
907 'admin' => CAP_ALLOW
908 )
909 ),
910
7191a1fa 911 'moodle/site:doclinks' => array(
bcdb0f19 912
7191a1fa 913 'captype' => 'read',
914 'contextlevel' => CONTEXT_SYSTEM,
915 'legacy' => array(
7191a1fa 916 'teacher' => CAP_ALLOW,
917 'editingteacher' => CAP_ALLOW,
7191a1fa 918 'admin' => CAP_ALLOW
919 )
3924b988 920 ),
eef868d1 921
3924b988 922 'moodle/course:sectionvisibility' => array(
bcdb0f19 923
3924b988 924 'captype' => 'write',
925 'contextlevel' => CONTEXT_COURSE,
926 'legacy' => array(
3924b988 927 'editingteacher' => CAP_ALLOW,
3924b988 928 'admin' => CAP_ALLOW
929 )
930 ),
eef868d1 931
dc558690 932 'moodle/course:useremail' => array(
bcdb0f19 933
dc558690 934 'captype' => 'write',
935 'contextlevel' => CONTEXT_COURSE,
936 'legacy' => array(
dc558690 937 'editingteacher' => CAP_ALLOW,
dc558690 938 'admin' => CAP_ALLOW
939 )
940 ),
eef868d1 941
3924b988 942 'moodle/course:viewhiddensections' => array(
bcdb0f19 943
3924b988 944 'captype' => 'write',
945 'contextlevel' => CONTEXT_COURSE,
946 'legacy' => array(
3924b988 947 'editingteacher' => CAP_ALLOW,
3924b988 948 'admin' => CAP_ALLOW
949 )
950 ),
eef868d1 951
3924b988 952 'moodle/course:setcurrentsection' => array(
bcdb0f19 953
3924b988 954 'captype' => 'write',
955 'contextlevel' => CONTEXT_COURSE,
956 'legacy' => array(
3924b988 957 'editingteacher' => CAP_ALLOW,
3924b988 958 'admin' => CAP_ALLOW
959 )
960 ),
eef868d1 961
dd45888a 962 'moodle/site:mnetlogintoremote' => array(
963 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
3924b988 964 'captype' => 'read',
dd45888a 965 'contextlevel' => CONTEXT_SYSTEM,
3924b988 966 'legacy' => array(
3924b988 967 'admin' => CAP_ALLOW
968 )
969 ),
eef868d1 970
dd45888a 971 'moodle/grade:viewall' => array(
bcdb0f19 972 'riskbitmask' => RISK_PERSONAL,
dd45888a 973 'captype' => 'read',
3924b988 974 'contextlevel' => CONTEXT_COURSE,
975 'legacy' => array(
dd45888a 976 'teacher' => CAP_ALLOW,
3924b988 977 'editingteacher' => CAP_ALLOW,
3924b988 978 'admin' => CAP_ALLOW
dd45888a 979 ),
980 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
f509ce06 981 ),
f43ce1ad 982
dd45888a 983 'moodle/grade:view' => array(
f509ce06 984 'captype' => 'read',
dd45888a 985 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_PERSONAL too
f509ce06 986 'legacy' => array(
dd45888a 987 'student' => CAP_ALLOW
f509ce06 988 )
ca9ffa18 989 ),
dd45888a 990
991 'moodle/grade:viewhidden' => array(
ca9ffa18 992 'riskbitmask' => RISK_PERSONAL,
993 'captype' => 'read',
dd45888a 994 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_PERSONAL too
ca9ffa18 995 'legacy' => array(
dd45888a 996 ),
997 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
ca9ffa18 998 ),
dd45888a 999
1000 'moodle/grade:import' => array(
ca9ffa18 1001 'riskbitmask' => RISK_PERSONAL,
dd45888a 1002 'captype' => 'write',
ca9ffa18 1003 'contextlevel' => CONTEXT_COURSE,
1004 'legacy' => array(
ca9ffa18 1005 'editingteacher' => CAP_ALLOW,
1006 'admin' => CAP_ALLOW
dd45888a 1007 ),
1008 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1009 ),
dd45888a 1010
1011 'moodle/grade:export' => array(
ca9ffa18 1012 'riskbitmask' => RISK_PERSONAL,
1013 'captype' => 'read',
1014 'contextlevel' => CONTEXT_COURSE,
1015 'legacy' => array(
1016 'teacher' => CAP_ALLOW,
1017 'editingteacher' => CAP_ALLOW,
1018 'admin' => CAP_ALLOW
dd45888a 1019 ),
1020 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1021 ),
dd45888a 1022
1023 'moodle/grade:manage' => array(
ca9ffa18 1024 'riskbitmask' => RISK_PERSONAL,
dd45888a 1025 'captype' => 'write',
1026 'contextlevel' => CONTEXT_COURSE,
ca9ffa18 1027 'legacy' => array(
dd45888a 1028 'editingteacher' => CAP_ALLOW,
ca9ffa18 1029 'admin' => CAP_ALLOW
dd45888a 1030 ),
1031 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1032 ),
dd45888a 1033
04259694 1034 'moodle/grade:manageoutcomes' => array(
1035 'riskbitmask' => RISK_PERSONAL,
1036 'captype' => 'write',
1037 'contextlevel' => CONTEXT_COURSE,
1038 'legacy' => array(
1039 'editingteacher' => CAP_ALLOW,
1040 'admin' => CAP_ALLOW
1041 ),
1042 'clonepermissionsfrom' => 'moodle/course:managegrades'
1043 ),
1044
ca9ffa18 1045 'moodle/grade:hide' => array(
1046 'captype' => 'write',
1047 'contextlevel' => CONTEXT_COURSE,
1048 'legacy' => array(
1049 'editingteacher' => CAP_ALLOW,
1050 'admin' => CAP_ALLOW
1051 )
1052 ),
dd45888a 1053
ca9ffa18 1054 'moodle/grade:lock' => array(
1055 'captype' => 'write',
1056 'contextlevel' => CONTEXT_COURSE,
1057 'legacy' => array(
1058 'editingteacher' => CAP_ALLOW,
1059 'admin' => CAP_ALLOW
1060 )
1061 ),
dd45888a 1062
1063 'moodle/grade:unlock' => array(
1064 'captype' => 'write',
ca9ffa18 1065 'contextlevel' => CONTEXT_COURSE,
1066 'legacy' => array(
1067 'editingteacher' => CAP_ALLOW,
1068 'admin' => CAP_ALLOW
1069 )
1070 ),
dd45888a 1071
1072 'moodle/grade:override' => array(
ca9ffa18 1073 'captype' => 'write',
1074 'contextlevel' => CONTEXT_COURSE,
1075 'legacy' => array(
1076 'editingteacher' => CAP_ALLOW,
1077 'admin' => CAP_ALLOW
1078 )
282c1695 1079 ),
dd45888a 1080
1081 'moodle/my:manageblocks' => array(
282c1695 1082 'captype' => 'write',
1083 'contextlevel' => CONTEXT_SYSTEM,
1084 'legacy' => array(
1085 'user' => CAP_ALLOW
1086 )
eca3af25 1087 ),
dd45888a 1088
eca3af25 1089 'moodle/notes:view' => array(
1090 'captype' => 'read',
1091 'contextlevel' => CONTEXT_SYSTEM,
1092 'legacy' => array(
1093 'teacher' => CAP_ALLOW,
1094 'editingteacher' => CAP_ALLOW,
1095 'admin' => CAP_ALLOW
1096 )
1097 ),
1098
1099 'moodle/notes:manage' => array(
1100 'captype' => 'write',
1101 'contextlevel' => CONTEXT_SYSTEM,
1102 'legacy' => array(
1103 'teacher' => CAP_ALLOW,
1104 'editingteacher' => CAP_ALLOW,
1105 'admin' => CAP_ALLOW
1106 )
dd45888a 1107 ),
79642064 1108
1109 'moodle/tag:manage' => array(
1110 'captype' => 'write',
1111 'contextlevel' => CONTEXT_SYSTEM,
1112 'legacy' => array(
1113 'teacher' => CAP_ALLOW,
1114 'editingteacher' => CAP_ALLOW,
1115 'admin' => CAP_ALLOW
1116 )
705789bd 1117 ),
1118
1119 'moodle/tag:create' => array(
1120 'captype' => 'write',
1121 'contextlevel' => CONTEXT_SYSTEM,
1122 'legacy' => array(
0f07c40e 1123 'admin' => CAP_ALLOW,
1124 'user' => CAP_ALLOW
705789bd 1125 )
1126 ),
1127
1128 'moodle/tag:edit' => array(
1129 'captype' => 'write',
1130 'contextlevel' => CONTEXT_SYSTEM,
1131 'legacy' => array(
3e6e529f 1132 'admin' => CAP_ALLOW,
1133 'user' => CAP_ALLOW
98b5789d 1134 )
1135 ),
1136
1137 'moodle/tag:editblocks' => array(
1138 'captype' => 'write',
1139 'contextlevel' => CONTEXT_SYSTEM,
1140 'legacy' => array(
705789bd 1141 'teacher' => CAP_ALLOW,
1142 'editingteacher' => CAP_ALLOW,
1143 'admin' => CAP_ALLOW
1144 )
7e874772 1145 ),
1146
1147 'moodle/block:view' => array(
1148 'captype' => 'read',
1149 'contextlevel' => CONTEXT_BLOCK,
1150 'legacy' => array(
1151 'guest' => CAP_ALLOW,
25a7d980 1152 'user' => CAP_ALLOW,
1153 'student' => CAP_ALLOW,
1154 'teacher' => CAP_ALLOW,
1155 'editingteacher' => CAP_ALLOW,
1156 'coursecreator' => CAP_ALLOW
7e874772 1157 )
79642064 1158 )
bbbf2d40 1159);
1160
98b5789d 1161
bbbf2d40 1162?>