merging MOODLE_19_QUESTIONS with HEAD
[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
945f88ca 802 'moodle/question:import' => array(
21b6db6e 803
804 'riskbitmask' => RISK_XSS,
805
945f88ca 806 'captype' => 'write',
807 'contextlevel' => CONTEXT_COURSE,
808 'legacy' => array(
945f88ca 809 'editingteacher' => CAP_ALLOW,
945f88ca 810 'admin' => CAP_ALLOW
811 )
812 ),
eef868d1 813
945f88ca 814 'moodle/question:export' => array(
bcdb0f19 815
945f88ca 816 'captype' => 'read',
817 'contextlevel' => CONTEXT_COURSE,
818 'legacy' => array(
945f88ca 819 'editingteacher' => CAP_ALLOW,
945f88ca 820 'admin' => CAP_ALLOW
821 )
822 ),
eef868d1 823
f43ce1ad 824 'moodle/question:managecategory' => array(
bcdb0f19 825
945f88ca 826 'captype' => 'write',
827 'contextlevel' => CONTEXT_COURSE,
828 'legacy' => array(
945f88ca 829 'editingteacher' => CAP_ALLOW,
945f88ca 830 'admin' => CAP_ALLOW
831 )
832 ),
eef868d1 833
945f88ca 834 'moodle/question:manage' => array(
21b6db6e 835
836 'riskbitmask' => RISK_XSS,
837
945f88ca 838 'captype' => 'write',
839 'contextlevel' => CONTEXT_COURSE,
840 'legacy' => array(
945f88ca 841 'editingteacher' => CAP_ALLOW,
945f88ca 842 'admin' => CAP_ALLOW
843 )
7191a1fa 844 ),
845
0eb6b04a 846 // Configure the installed question types.
847 'moodle/question:config' => array(
848
849 'riskbitmask' => RISK_CONFIG,
850
851 'captype' => 'write',
852 'contextlevel' => CONTEXT_SYSTEM,
853 'legacy' => array(
854 'admin' => CAP_ALLOW
855 )
856 ),
857
7191a1fa 858 'moodle/site:doclinks' => array(
bcdb0f19 859
7191a1fa 860 'captype' => 'read',
861 'contextlevel' => CONTEXT_SYSTEM,
862 'legacy' => array(
7191a1fa 863 'teacher' => CAP_ALLOW,
864 'editingteacher' => CAP_ALLOW,
7191a1fa 865 'admin' => CAP_ALLOW
866 )
3924b988 867 ),
eef868d1 868
3924b988 869 'moodle/course:sectionvisibility' => array(
bcdb0f19 870
3924b988 871 'captype' => 'write',
872 'contextlevel' => CONTEXT_COURSE,
873 'legacy' => array(
3924b988 874 'editingteacher' => CAP_ALLOW,
3924b988 875 'admin' => CAP_ALLOW
876 )
877 ),
eef868d1 878
dc558690 879 'moodle/course:useremail' => array(
bcdb0f19 880
dc558690 881 'captype' => 'write',
882 'contextlevel' => CONTEXT_COURSE,
883 'legacy' => array(
dc558690 884 'editingteacher' => CAP_ALLOW,
dc558690 885 'admin' => CAP_ALLOW
886 )
887 ),
eef868d1 888
3924b988 889 'moodle/course:viewhiddensections' => array(
bcdb0f19 890
3924b988 891 'captype' => 'write',
892 'contextlevel' => CONTEXT_COURSE,
893 'legacy' => array(
3924b988 894 'editingteacher' => CAP_ALLOW,
3924b988 895 'admin' => CAP_ALLOW
896 )
897 ),
eef868d1 898
3924b988 899 'moodle/course:setcurrentsection' => array(
bcdb0f19 900
3924b988 901 'captype' => 'write',
902 'contextlevel' => CONTEXT_COURSE,
903 'legacy' => array(
3924b988 904 'editingteacher' => CAP_ALLOW,
3924b988 905 'admin' => CAP_ALLOW
906 )
907 ),
eef868d1 908
dd45888a 909 'moodle/site:mnetlogintoremote' => array(
910 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
3924b988 911 'captype' => 'read',
dd45888a 912 'contextlevel' => CONTEXT_SYSTEM,
3924b988 913 'legacy' => array(
3924b988 914 'admin' => CAP_ALLOW
915 )
916 ),
eef868d1 917
dd45888a 918 'moodle/grade:viewall' => array(
bcdb0f19 919 'riskbitmask' => RISK_PERSONAL,
dd45888a 920 'captype' => 'read',
3924b988 921 'contextlevel' => CONTEXT_COURSE,
922 'legacy' => array(
dd45888a 923 'teacher' => CAP_ALLOW,
3924b988 924 'editingteacher' => CAP_ALLOW,
3924b988 925 'admin' => CAP_ALLOW
dd45888a 926 ),
927 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
f509ce06 928 ),
f43ce1ad 929
dd45888a 930 'moodle/grade:view' => array(
f509ce06 931 'captype' => 'read',
dd45888a 932 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_PERSONAL too
f509ce06 933 'legacy' => array(
dd45888a 934 'student' => CAP_ALLOW
f509ce06 935 )
ca9ffa18 936 ),
dd45888a 937
938 'moodle/grade:viewhidden' => array(
ca9ffa18 939 'riskbitmask' => RISK_PERSONAL,
940 'captype' => 'read',
dd45888a 941 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_PERSONAL too
ca9ffa18 942 'legacy' => array(
dd45888a 943 ),
944 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
ca9ffa18 945 ),
dd45888a 946
947 'moodle/grade:import' => array(
ca9ffa18 948 'riskbitmask' => RISK_PERSONAL,
dd45888a 949 'captype' => 'write',
ca9ffa18 950 'contextlevel' => CONTEXT_COURSE,
951 'legacy' => array(
ca9ffa18 952 'editingteacher' => CAP_ALLOW,
953 'admin' => CAP_ALLOW
dd45888a 954 ),
955 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 956 ),
dd45888a 957
958 'moodle/grade:export' => array(
ca9ffa18 959 'riskbitmask' => RISK_PERSONAL,
960 'captype' => 'read',
961 'contextlevel' => CONTEXT_COURSE,
962 'legacy' => array(
963 'teacher' => CAP_ALLOW,
964 'editingteacher' => CAP_ALLOW,
965 'admin' => CAP_ALLOW
dd45888a 966 ),
967 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 968 ),
dd45888a 969
970 'moodle/grade:manage' => array(
ca9ffa18 971 'riskbitmask' => RISK_PERSONAL,
dd45888a 972 'captype' => 'write',
973 'contextlevel' => CONTEXT_COURSE,
ca9ffa18 974 'legacy' => array(
dd45888a 975 'editingteacher' => CAP_ALLOW,
ca9ffa18 976 'admin' => CAP_ALLOW
dd45888a 977 ),
978 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 979 ),
dd45888a 980
04259694 981 'moodle/grade:manageoutcomes' => array(
982 'riskbitmask' => RISK_PERSONAL,
983 'captype' => 'write',
984 'contextlevel' => CONTEXT_COURSE,
985 'legacy' => array(
986 'editingteacher' => CAP_ALLOW,
987 'admin' => CAP_ALLOW
988 ),
989 'clonepermissionsfrom' => 'moodle/course:managegrades'
990 ),
991
ca9ffa18 992 'moodle/grade:hide' => array(
993 'captype' => 'write',
994 'contextlevel' => CONTEXT_COURSE,
995 'legacy' => array(
996 'editingteacher' => CAP_ALLOW,
997 'admin' => CAP_ALLOW
998 )
999 ),
dd45888a 1000
ca9ffa18 1001 'moodle/grade:lock' => array(
1002 'captype' => 'write',
1003 'contextlevel' => CONTEXT_COURSE,
1004 'legacy' => array(
1005 'editingteacher' => CAP_ALLOW,
1006 'admin' => CAP_ALLOW
1007 )
1008 ),
dd45888a 1009
1010 'moodle/grade:unlock' => array(
1011 'captype' => 'write',
ca9ffa18 1012 'contextlevel' => CONTEXT_COURSE,
1013 'legacy' => array(
1014 'editingteacher' => CAP_ALLOW,
1015 'admin' => CAP_ALLOW
1016 )
1017 ),
dd45888a 1018
1019 'moodle/grade:override' => array(
ca9ffa18 1020 'captype' => 'write',
1021 'contextlevel' => CONTEXT_COURSE,
1022 'legacy' => array(
1023 'editingteacher' => CAP_ALLOW,
1024 'admin' => CAP_ALLOW
1025 )
282c1695 1026 ),
dd45888a 1027
1028 'moodle/my:manageblocks' => array(
282c1695 1029 'captype' => 'write',
1030 'contextlevel' => CONTEXT_SYSTEM,
1031 'legacy' => array(
1032 'user' => CAP_ALLOW
1033 )
eca3af25 1034 ),
dd45888a 1035
eca3af25 1036 'moodle/notes:view' => array(
1037 'captype' => 'read',
1038 'contextlevel' => CONTEXT_SYSTEM,
1039 'legacy' => array(
1040 'teacher' => CAP_ALLOW,
1041 'editingteacher' => CAP_ALLOW,
1042 'admin' => CAP_ALLOW
1043 )
1044 ),
1045
1046 'moodle/notes:manage' => array(
1047 'captype' => 'write',
1048 'contextlevel' => CONTEXT_SYSTEM,
1049 'legacy' => array(
1050 'teacher' => CAP_ALLOW,
1051 'editingteacher' => CAP_ALLOW,
1052 'admin' => CAP_ALLOW
1053 )
dd45888a 1054 ),
79642064 1055
1056 'moodle/tag:manage' => array(
1057 'captype' => 'write',
1058 'contextlevel' => CONTEXT_SYSTEM,
1059 'legacy' => array(
1060 'teacher' => CAP_ALLOW,
1061 'editingteacher' => CAP_ALLOW,
1062 'admin' => CAP_ALLOW
1063 )
705789bd 1064 ),
1065
1066 'moodle/tag:create' => array(
1067 'captype' => 'write',
1068 'contextlevel' => CONTEXT_SYSTEM,
1069 'legacy' => array(
1070 'student' => CAP_ALLOW,
1071 'teacher' => CAP_ALLOW,
1072 'editingteacher' => CAP_ALLOW,
1073 'admin' => CAP_ALLOW
1074 )
1075 ),
1076
1077 'moodle/tag:edit' => array(
1078 'captype' => 'write',
1079 'contextlevel' => CONTEXT_SYSTEM,
1080 'legacy' => array(
1081 'student' => CAP_ALLOW,
1082 'teacher' => CAP_ALLOW,
1083 'editingteacher' => CAP_ALLOW,
1084 'admin' => CAP_ALLOW
1085 )
79642064 1086 )
bbbf2d40 1087);
1088
1089?>