Improve javadocs.
[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
6df3c7df 241
242 'moodle/user:create' => array(
243
244 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
eef868d1 245
bbbf2d40 246 'captype' => 'write',
247 'contextlevel' => CONTEXT_SYSTEM,
248 'legacy' => array(
bbbf2d40 249 'admin' => CAP_ALLOW
250 )
251 ),
eef868d1 252
6df3c7df 253 'moodle/user:delete' => array(
cc891abe 254
bcdb0f19 255 'riskbitmask' => RISK_PERSONAL,
256
cc891abe 257 'captype' => 'write',
258 'contextlevel' => CONTEXT_SYSTEM,
259 'legacy' => array(
cc891abe 260 'admin' => CAP_ALLOW
261 )
262 ),
263
6df3c7df 264 'moodle/user:update' => array(
cc891abe 265
266 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
21b6db6e 267
bbbf2d40 268 'captype' => 'write',
269 'contextlevel' => CONTEXT_SYSTEM,
270 'legacy' => array(
bbbf2d40 271 'admin' => CAP_ALLOW
272 )
273 ),
eef868d1 274
bbbf2d40 275 'moodle/user:viewdetails' => array(
eef868d1 276
e58eca72 277 'captype' => 'read',
bbbf2d40 278 'contextlevel' => CONTEXT_SYSTEM,
279 'legacy' => array(
22ae509e 280 'guest' => CAP_ALLOW,
281 'student' => CAP_ALLOW,
282 'teacher' => CAP_ALLOW,
283 'editingteacher' => CAP_ALLOW,
bbbf2d40 284 'admin' => CAP_ALLOW
285 )
286 ),
e58eca72 287
288 'moodle/user:viewhiddendetails' => array(
eef868d1 289
21b6db6e 290 'riskbitmask' => RISK_PERSONAL,
291
e58eca72 292 'captype' => 'read',
293 'contextlevel' => CONTEXT_SYSTEM,
294 'legacy' => array(
e58eca72 295 'teacher' => CAP_ALLOW,
296 'editingteacher' => CAP_ALLOW,
e58eca72 297 'admin' => CAP_ALLOW
298 )
299 ),
eef868d1 300
6c95827f 301 'moodle/user:viewusergrades' => array(
bcdb0f19 302
6c95827f 303 'captype' => 'write',
304 'contextlevel' => CONTEXT_COURSE,
305 'legacy' => array(
6c95827f 306 'student' => CAP_ALLOW,
307 'teacher' => CAP_ALLOW,
308 'editingteacher' => CAP_ALLOW,
6c95827f 309 'admin' => CAP_ALLOW
310 )
311 ),
bcdb0f19 312
6c95827f 313 'moodle/user:loginas' => array(
314
315 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
316
317 'captype' => 'write',
318 'contextlevel' => CONTEXT_COURSE,
319 'legacy' => array(
6c95827f 320 'admin' => CAP_ALLOW
321 )
322 ),
323
bbbf2d40 324 'moodle/role:assign' => array(
eef868d1 325
bbbf2d40 326 'captype' => 'write',
327 'contextlevel' => CONTEXT_SYSTEM,
328 'legacy' => array(
861fdcaa 329 'editingteacher' => CAP_ALLOW,
68c52526 330 'admin' => CAP_ALLOW
331 )
332 ),
eef868d1 333
68c52526 334 'moodle/role:override' => array(
eef868d1 335
bcdb0f19 336 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
337
68c52526 338 'captype' => 'write',
339 'contextlevel' => CONTEXT_SYSTEM,
340 'legacy' => array(
bbbf2d40 341 'admin' => CAP_ALLOW
342 )
343 ),
eef868d1 344
bbbf2d40 345 'moodle/role:manage' => array(
eef868d1 346
bcdb0f19 347 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
348
bbbf2d40 349 'captype' => 'write',
350 'contextlevel' => CONTEXT_SYSTEM,
351 'legacy' => array(
bbbf2d40 352 'admin' => CAP_ALLOW
353 )
354 ),
f43ce1ad 355
356 'moodle/role:unassignself' => array(
bcdb0f19 357
f43ce1ad 358 'captype' => 'write',
359 'contextlevel' => CONTEXT_SYSTEM,
360 'legacy' => array(
2d5a4f25 361 'student' => (empty($CFG->allowunenrol)) ? CAP_INHERIT : CAP_ALLOW,
f43ce1ad 362 'teacher' => CAP_ALLOW,
363 'editingteacher' => CAP_ALLOW,
364 'coursecreator' => CAP_ALLOW,
365 'admin' => CAP_ALLOW
366 )
367 ),
99f9cb51 368
369 'moodle/role:viewhiddenassigns' => array(
bcdb0f19 370
99f9cb51 371 'captype' => 'read',
372 'contextlevel' => CONTEXT_SYSTEM,
373 'legacy' => array(
99f9cb51 374 'teacher' => CAP_ALLOW,
375 'editingteacher' => CAP_ALLOW,
99f9cb51 376 'admin' => CAP_ALLOW
377 )
378 ),
eef868d1 379
20dd4cf5 380 'moodle/role:switchroles' => array(
bcdb0f19 381
20dd4cf5 382 'riskbitmask' => RISK_XSS,
bcdb0f19 383
20dd4cf5 384 'captype' => 'read',
385 'contextlevel' => CONTEXT_SYSTEM,
386 'legacy' => array(
20dd4cf5 387 'editingteacher' => CAP_ALLOW,
20dd4cf5 388 'admin' => CAP_ALLOW
389 )
390 ),
391
bbbf2d40 392 'moodle/category:create' => array(
eef868d1 393
89a792ab 394 'riskbitmask' => RISK_XSS,
395
bbbf2d40 396 'captype' => 'write',
397 'contextlevel' => CONTEXT_COURSECAT,
398 'legacy' => array(
bbbf2d40 399 'admin' => CAP_ALLOW
400 )
401 ),
eef868d1 402
bbbf2d40 403 'moodle/category:delete' => array(
eef868d1 404
bbbf2d40 405 'captype' => 'write',
406 'contextlevel' => CONTEXT_COURSECAT,
407 'legacy' => array(
bbbf2d40 408 'admin' => CAP_ALLOW
409 )
410 ),
eef868d1 411
bbbf2d40 412 'moodle/category:update' => array(
eef868d1 413
89a792ab 414 'riskbitmask' => RISK_XSS,
415
bbbf2d40 416 'captype' => 'write',
417 'contextlevel' => CONTEXT_COURSECAT,
418 'legacy' => array(
bbbf2d40 419 'admin' => CAP_ALLOW
420 )
421 ),
eef868d1 422
bbbf2d40 423 'moodle/category:visibility' => array(
eef868d1 424
bbbf2d40 425 'captype' => 'write',
426 'contextlevel' => CONTEXT_COURSECAT,
427 'legacy' => array(
bbbf2d40 428 'admin' => CAP_ALLOW
429 )
430 ),
eef868d1 431
bbbf2d40 432 'moodle/course:create' => array(
eef868d1 433
21b6db6e 434 'riskbitmask' => RISK_XSS,
435
bbbf2d40 436 'captype' => 'write',
5e992f56 437 'contextlevel' => CONTEXT_COURSECAT,
bbbf2d40 438 'legacy' => array(
4473252d 439 'coursecreator' => CAP_ALLOW,
bbbf2d40 440 'admin' => CAP_ALLOW
441 )
442 ),
eef868d1 443
bbbf2d40 444 'moodle/course:delete' => array(
eef868d1 445
bbbf2d40 446 'captype' => 'write',
447 'contextlevel' => CONTEXT_COURSE,
448 'legacy' => array(
bbbf2d40 449 'admin' => CAP_ALLOW
450 )
451 ),
eef868d1 452
bbbf2d40 453 'moodle/course:update' => array(
eef868d1 454
21b6db6e 455 'riskbitmask' => RISK_XSS,
456
bbbf2d40 457 'captype' => 'write',
458 'contextlevel' => CONTEXT_COURSE,
459 'legacy' => array(
bbbf2d40 460 'editingteacher' => CAP_ALLOW,
bbbf2d40 461 'admin' => CAP_ALLOW
462 )
463 ),
eef868d1 464
bbbf2d40 465 'moodle/course:view' => array(
eef868d1 466
bbbf2d40 467 'captype' => 'read',
468 'contextlevel' => CONTEXT_COURSE,
469 'legacy' => array(
b0f55230 470 'guest' => CAP_ALLOW,
bbbf2d40 471 'student' => CAP_ALLOW,
472 'teacher' => CAP_ALLOW,
72cf2e39 473 'editingteacher' => CAP_ALLOW
bbbf2d40 474 )
475 ),
eef868d1 476
77c645df 477 'moodle/course:bulkmessaging' => array(
478
479 'riskbitmask' => RISK_SPAM,
480
481 'captype' => 'write',
482 'contextlevel' => CONTEXT_COURSE,
483 'legacy' => array(
77c645df 484 'teacher' => CAP_ALLOW,
485 'editingteacher' => CAP_ALLOW,
77c645df 486 'admin' => CAP_ALLOW
487 )
488 ),
489
1c45e42e 490 'moodle/course:viewhiddenuserfields' => array(
eef868d1 491
21b6db6e 492 'riskbitmask' => RISK_PERSONAL,
493
1c45e42e 494 'captype' => 'read',
495 'contextlevel' => CONTEXT_COURSE,
496 'legacy' => array(
1c45e42e 497 'teacher' => CAP_ALLOW,
498 'editingteacher' => CAP_ALLOW,
1c45e42e 499 'admin' => CAP_ALLOW
500 )
501 ),
eef868d1 502
1c45e42e 503 'moodle/course:viewhiddencourses' => array(
eef868d1 504
1c45e42e 505 'captype' => 'read',
506 'contextlevel' => CONTEXT_COURSE,
507 'legacy' => array(
2f5ab42b 508 'coursecreator' => CAP_ALLOW,
509 'teacher' => CAP_ALLOW,
510 'editingteacher' => CAP_ALLOW,
511 'admin' => CAP_ALLOW
1c45e42e 512 )
513 ),
eef868d1 514
bbbf2d40 515 'moodle/course:visibility' => array(
eef868d1 516
bbbf2d40 517 'captype' => 'write',
518 'contextlevel' => CONTEXT_COURSE,
519 'legacy' => array(
bbbf2d40 520 'admin' => CAP_ALLOW
521 )
522 ),
eef868d1 523
a028c291 524 'moodle/course:managefiles' => array(
eef868d1 525
21b6db6e 526 'riskbitmask' => RISK_XSS,
527
a028c291 528 'captype' => 'write',
529 'contextlevel' => CONTEXT_COURSE,
530 'legacy' => array(
a028c291 531 'editingteacher' => CAP_ALLOW,
a028c291 532 'admin' => CAP_ALLOW
533 )
534 ),
eef868d1 535
bbbf2d40 536 'moodle/course:manageactivities' => array(
eef868d1 537
21b6db6e 538 'riskbitmask' => RISK_XSS,
539
bbbf2d40 540 'captype' => 'write',
541 'contextlevel' => CONTEXT_COURSE,
542 'legacy' => array(
bbbf2d40 543 'editingteacher' => CAP_ALLOW,
bbbf2d40 544 'admin' => CAP_ALLOW
545 )
546 ),
eef868d1 547
b79da3ac 548 'moodle/course:managemetacourse' => array(
eef868d1 549
4b7aaf40 550 'captype' => 'write',
551 'contextlevel' => CONTEXT_COURSE,
552 'legacy' => array(
4b7aaf40 553 'editingteacher' => CAP_ALLOW,
4b7aaf40 554 'admin' => CAP_ALLOW
555 )
556 ),
eef868d1 557
bbbf2d40 558 'moodle/course:activityvisibility' => array(
eef868d1 559
bbbf2d40 560 'captype' => 'write',
561 'contextlevel' => CONTEXT_COURSE,
562 'legacy' => array(
bbbf2d40 563 'editingteacher' => CAP_ALLOW,
bbbf2d40 564 'admin' => CAP_ALLOW
565 )
566 ),
eef868d1 567
bbbf2d40 568 'moodle/course:viewhiddenactivities' => array(
eef868d1 569
bbbf2d40 570 'captype' => 'write',
571 'contextlevel' => CONTEXT_COURSE,
572 'legacy' => array(
bbbf2d40 573 'teacher' => CAP_ALLOW,
574 'editingteacher' => CAP_ALLOW,
bbbf2d40 575 'admin' => CAP_ALLOW
576 )
577 ),
eef868d1 578
bbbf2d40 579 'moodle/course:viewparticipants' => array(
eef868d1 580
bbbf2d40 581 'captype' => 'read',
582 'contextlevel' => CONTEXT_COURSE,
583 'legacy' => array(
bbbf2d40 584 'student' => CAP_ALLOW,
585 'teacher' => CAP_ALLOW,
586 'editingteacher' => CAP_ALLOW,
bbbf2d40 587 'admin' => CAP_ALLOW
588 )
589 ),
eef868d1 590
bbbf2d40 591 'moodle/course:viewscales' => array(
eef868d1 592
bbbf2d40 593 'captype' => 'read',
594 'contextlevel' => CONTEXT_COURSE,
595 'legacy' => array(
bbbf2d40 596 'student' => CAP_ALLOW,
597 'teacher' => CAP_ALLOW,
598 'editingteacher' => CAP_ALLOW,
bbbf2d40 599 'admin' => CAP_ALLOW
600 )
601 ),
eef868d1 602
bbbf2d40 603 'moodle/course:managescales' => array(
eef868d1 604
bbbf2d40 605 'captype' => 'write',
606 'contextlevel' => CONTEXT_COURSE,
607 'legacy' => array(
bbbf2d40 608 'editingteacher' => CAP_ALLOW,
bbbf2d40 609 'admin' => CAP_ALLOW
610 )
611 ),
eef868d1 612
bbbf2d40 613 'moodle/course:managegroups' => array(
614
615 'captype' => 'write',
616 'contextlevel' => CONTEXT_COURSE,
a028c291 617 'legacy' => array(
a028c291 618 'editingteacher' => CAP_ALLOW,
a028c291 619 'admin' => CAP_ALLOW
620 )
621 ),
eef868d1 622
a028c291 623 'moodle/course:reset' => array(
624
625 'captype' => 'write',
626 'contextlevel' => CONTEXT_COURSE,
bbbf2d40 627 'legacy' => array(
bbbf2d40 628 'editingteacher' => CAP_ALLOW,
bbbf2d40 629 'admin' => CAP_ALLOW
630 )
631 ),
eef868d1 632
bbbf2d40 633 'moodle/blog:view' => array(
634
635 'captype' => 'read',
636 'contextlevel' => CONTEXT_SYSTEM,
637 'legacy' => array(
00adf177 638 'guest' => CAP_ALLOW,
c785d40a 639 'user' => CAP_ALLOW,
bbbf2d40 640 'student' => CAP_ALLOW,
641 'teacher' => CAP_ALLOW,
642 'editingteacher' => CAP_ALLOW,
bbbf2d40 643 'admin' => CAP_ALLOW
644 )
645 ),
eef868d1 646
5a8ab2e9 647 'moodle/blog:create' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 648
21b6db6e 649 'riskbitmask' => RISK_SPAM,
650
bbbf2d40 651 'captype' => 'write',
652 'contextlevel' => CONTEXT_SYSTEM,
653 'legacy' => array(
c785d40a 654 'user' => CAP_ALLOW,
bbbf2d40 655 'admin' => CAP_ALLOW
656 )
657 ),
eef868d1 658
bbbf2d40 659 'moodle/blog:manageofficialtags' => array(
660
21b6db6e 661 'riskbitmask' => RISK_SPAM,
662
bbbf2d40 663 'captype' => 'write',
664 'contextlevel' => CONTEXT_SYSTEM,
665 'legacy' => array(
bbbf2d40 666 'admin' => CAP_ALLOW
667 )
668 ),
eef868d1 669
bbbf2d40 670 'moodle/blog:managepersonaltags' => array(
671
21b6db6e 672 'riskbitmask' => RISK_SPAM,
673
bbbf2d40 674 'captype' => 'write',
675 'contextlevel' => CONTEXT_SYSTEM,
676 'legacy' => array(
bbbf2d40 677 'student' => CAP_ALLOW,
678 'teacher' => CAP_ALLOW,
679 'editingteacher' => CAP_ALLOW,
bbbf2d40 680 'admin' => CAP_ALLOW
681 )
682 ),
eef868d1 683
bbbf2d40 684 'moodle/blog:manageentries' => array(
685
21b6db6e 686 'riskbitmask' => RISK_SPAM,
687
bbbf2d40 688 'captype' => 'write',
689 'contextlevel' => CONTEXT_SYSTEM,
690 'legacy' => array(
bbbf2d40 691 'teacher' => CAP_ALLOW,
692 'editingteacher' => CAP_ALLOW,
bbbf2d40 693 'admin' => CAP_ALLOW
694 )
695 ),
eef868d1 696
5a8ab2e9 697 'moodle/calendar:manageownentries' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 698
21b6db6e 699 'riskbitmask' => RISK_SPAM,
700
bbbf2d40 701 'captype' => 'write',
702 'contextlevel' => CONTEXT_SYSTEM,
703 'legacy' => array(
c785d40a 704 'user' => CAP_ALLOW,
bbbf2d40 705 'admin' => CAP_ALLOW
706 )
707 ),
eef868d1 708
bbbf2d40 709 'moodle/calendar:manageentries' => array(
710
21b6db6e 711 'riskbitmask' => RISK_SPAM,
712
bbbf2d40 713 'captype' => 'write',
714 'contextlevel' => CONTEXT_SYSTEM,
715 'legacy' => array(
bbbf2d40 716 'teacher' => CAP_ALLOW,
717 'editingteacher' => CAP_ALLOW,
bbbf2d40 718 'admin' => CAP_ALLOW
719 )
77d4953e 720 ),
a044c05d 721
722 'moodle/user:editprofile' => array(
723
724 'riskbitmask' => RISK_SPAM,
725
726 'captype' => 'write',
727 'contextlevel' => CONTEXT_USER,
728 'legacy' => array(
729 'admin' => CAP_ALLOW
730 )
731 ),
eef868d1 732
1cb3da36 733 'moodle/user:editownprofile' => array(
734
735 'captype' => 'write',
736 'contextlevel' => CONTEXT_SYSTEM,
737 'legacy' => array(
738 'guest' => CAP_PROHIBIT,
739 'user' => CAP_ALLOW,
740 'admin' => CAP_ALLOW
741 )
742 ),
743
744 'moodle/user:changeownpassword' => array(
745
746 'captype' => 'write',
747 'contextlevel' => CONTEXT_SYSTEM,
748 'legacy' => array(
749 'guest' => CAP_PROHIBIT,
750 'user' => CAP_ALLOW,
751 'admin' => CAP_ALLOW
752 )
753 ),
754
eef868d1 755 // The next 3 might make no sense for some roles, e.g teacher, etc.
77d4953e 756 // since the next level up is site. These are more for the parent role
757 'moodle/user:readuserposts' => array(
bcdb0f19 758
77d4953e 759 'captype' => 'read',
4b10f08b 760 'contextlevel' => CONTEXT_USER,
77d4953e 761 'legacy' => array(
77d4953e 762 'student' => CAP_ALLOW,
763 'teacher' => CAP_ALLOW,
764 'editingteacher' => CAP_ALLOW,
77d4953e 765 'admin' => CAP_ALLOW
766 )
767 ),
eef868d1 768
77d4953e 769 'moodle/user:readuserblogs' => array(
bcdb0f19 770
77d4953e 771 'captype' => 'read',
4b10f08b 772 'contextlevel' => CONTEXT_USER,
77d4953e 773 'legacy' => array(
77d4953e 774 'student' => CAP_ALLOW,
775 'teacher' => CAP_ALLOW,
776 'editingteacher' => CAP_ALLOW,
77d4953e 777 'admin' => CAP_ALLOW
778 )
779 ),
eef868d1 780
77d4953e 781 'moodle/user:viewuseractivitiesreport' => array(
bcdb0f19 782
77d4953e 783 'captype' => 'read',
4b10f08b 784 'contextlevel' => CONTEXT_USER,
77d4953e 785 'legacy' => array(
77d4953e 786 'teacher' => CAP_ALLOW,
787 'editingteacher' => CAP_ALLOW,
77d4953e 788 'admin' => CAP_ALLOW
789 )
945f88ca 790 ),
eef868d1 791
945f88ca 792 'moodle/question:import' => array(
21b6db6e 793
794 'riskbitmask' => RISK_XSS,
795
945f88ca 796 'captype' => 'write',
797 'contextlevel' => CONTEXT_COURSE,
798 'legacy' => array(
945f88ca 799 'editingteacher' => CAP_ALLOW,
945f88ca 800 'admin' => CAP_ALLOW
801 )
802 ),
eef868d1 803
945f88ca 804 'moodle/question:export' => array(
bcdb0f19 805
945f88ca 806 'captype' => 'read',
807 'contextlevel' => CONTEXT_COURSE,
808 'legacy' => array(
945f88ca 809 'editingteacher' => CAP_ALLOW,
945f88ca 810 'admin' => CAP_ALLOW
811 )
812 ),
eef868d1 813
f43ce1ad 814 'moodle/question:managecategory' => array(
bcdb0f19 815
945f88ca 816 'captype' => 'write',
817 'contextlevel' => CONTEXT_COURSE,
818 'legacy' => array(
945f88ca 819 'editingteacher' => CAP_ALLOW,
945f88ca 820 'admin' => CAP_ALLOW
821 )
822 ),
eef868d1 823
945f88ca 824 'moodle/question:manage' => array(
21b6db6e 825
826 'riskbitmask' => RISK_XSS,
827
945f88ca 828 'captype' => 'write',
829 'contextlevel' => CONTEXT_COURSE,
830 'legacy' => array(
945f88ca 831 'editingteacher' => CAP_ALLOW,
945f88ca 832 'admin' => CAP_ALLOW
833 )
7191a1fa 834 ),
835
0eb6b04a 836 // Configure the installed question types.
837 'moodle/question:config' => array(
838
839 'riskbitmask' => RISK_CONFIG,
840
841 'captype' => 'write',
842 'contextlevel' => CONTEXT_SYSTEM,
843 'legacy' => array(
844 'admin' => CAP_ALLOW
845 )
846 ),
847
7191a1fa 848 'moodle/site:doclinks' => array(
bcdb0f19 849
7191a1fa 850 'captype' => 'read',
851 'contextlevel' => CONTEXT_SYSTEM,
852 'legacy' => array(
7191a1fa 853 'teacher' => CAP_ALLOW,
854 'editingteacher' => CAP_ALLOW,
7191a1fa 855 'admin' => CAP_ALLOW
856 )
3924b988 857 ),
eef868d1 858
3924b988 859 'moodle/course:sectionvisibility' => array(
bcdb0f19 860
3924b988 861 'captype' => 'write',
862 'contextlevel' => CONTEXT_COURSE,
863 'legacy' => array(
3924b988 864 'editingteacher' => CAP_ALLOW,
3924b988 865 'admin' => CAP_ALLOW
866 )
867 ),
eef868d1 868
dc558690 869 'moodle/course:useremail' => array(
bcdb0f19 870
dc558690 871 'captype' => 'write',
872 'contextlevel' => CONTEXT_COURSE,
873 'legacy' => array(
dc558690 874 'editingteacher' => CAP_ALLOW,
dc558690 875 'admin' => CAP_ALLOW
876 )
877 ),
eef868d1 878
3924b988 879 'moodle/course:viewhiddensections' => array(
bcdb0f19 880
3924b988 881 'captype' => 'write',
882 'contextlevel' => CONTEXT_COURSE,
883 'legacy' => array(
3924b988 884 'editingteacher' => CAP_ALLOW,
3924b988 885 'admin' => CAP_ALLOW
886 )
887 ),
eef868d1 888
3924b988 889 'moodle/course:setcurrentsection' => 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:viewcoursegrades' => array(
bcdb0f19 900
901 'riskbitmask' => RISK_PERSONAL,
902
3924b988 903 'captype' => 'read',
904 'contextlevel' => CONTEXT_COURSE,
905 'legacy' => array(
3924b988 906 'teacher' => CAP_ALLOW,
907 'editingteacher' => CAP_ALLOW,
3924b988 908 'admin' => CAP_ALLOW
909 )
910 ),
eef868d1 911
3924b988 912 'moodle/course:managegrades' => array(
bcdb0f19 913
914 'riskbitmask' => RISK_PERSONAL,
915
3924b988 916 'captype' => 'write',
917 'contextlevel' => CONTEXT_COURSE,
918 'legacy' => array(
3924b988 919 'editingteacher' => CAP_ALLOW,
3924b988 920 'admin' => CAP_ALLOW
921 )
f509ce06 922 ),
f43ce1ad 923
f509ce06 924 'moodle/site:mnetlogintoremote' => array(
925 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
926 'captype' => 'read',
927 'contextlevel' => CONTEXT_SYSTEM,
928 'legacy' => array(
929 'admin' => CAP_ALLOW
930 )
ca9ffa18 931 ),
932
933 'moodle/course:viewowngrades' => array(
934 'riskbitmask' => RISK_PERSONAL,
935 'captype' => 'read',
936 'contextlevel' => CONTEXT_COURSE,
937 'legacy' => array(
938 'student' => CAP_ALLOW,
939 'teacher' => CAP_ALLOW,
940 'editingteacher' => CAP_ALLOW,
941 'admin' => CAP_ALLOW
942 )
943 ),
944
945 'moodle/course:viewallgrades' => array(
946 'riskbitmask' => RISK_PERSONAL,
947 'captype' => 'read',
948 'contextlevel' => CONTEXT_COURSE,
949 'legacy' => array(
950 'teacher' => CAP_ALLOW,
951 'editingteacher' => CAP_ALLOW,
952 'admin' => CAP_ALLOW
953 )
954 ),
955
956 'moodle/course:downloadallgrades' => array(
957 'riskbitmask' => RISK_PERSONAL,
958 'captype' => 'read',
959 'contextlevel' => CONTEXT_COURSE,
960 'legacy' => array(
961 'teacher' => CAP_ALLOW,
962 'editingteacher' => CAP_ALLOW,
963 'admin' => CAP_ALLOW
964 )
965 ),
966
967 'moodle/user:viewusergrades' => array(
968 'riskbitmask' => RISK_PERSONAL,
969 'captype' => 'read',
970 'contextlevel' => CONTEXT_USER,
971 'legacy' => array(
972 'admin' => CAP_ALLOW
973 )
974 ),
975
976 'moodle/grade:hide' => array(
977 'captype' => 'write',
978 'contextlevel' => CONTEXT_COURSE,
979 'legacy' => array(
980 'editingteacher' => CAP_ALLOW,
981 'admin' => CAP_ALLOW
982 )
983 ),
984
985 'moodle/grade:lock' => array(
986 'captype' => 'write',
987 'contextlevel' => CONTEXT_COURSE,
988 'legacy' => array(
989 'editingteacher' => CAP_ALLOW,
990 'admin' => CAP_ALLOW
991 )
992 ),
993
994 'moodle/grade:viewhidden' => array(
995 'captype' => 'read',
996 'contextlevel' => CONTEXT_COURSE,
997 'legacy' => array(
998 'editingteacher' => CAP_ALLOW,
999 'admin' => CAP_ALLOW
1000 )
1001 ),
1002
1003 'moodle/grade:editlocked' => array(
1004 'captype' => 'write',
1005 'contextlevel' => CONTEXT_COURSE,
1006 'legacy' => array(
1007 'editingteacher' => CAP_ALLOW,
1008 'admin' => CAP_ALLOW
1009 )
282c1695 1010 ),
1011
1012 'moodle/my:manageblocks' => array(
1013 'captype' => 'write',
1014 'contextlevel' => CONTEXT_SYSTEM,
1015 'legacy' => array(
1016 'user' => CAP_ALLOW
1017 )
eca3af25 1018 ),
1019
1020 'moodle/notes:view' => array(
1021 'captype' => 'read',
1022 'contextlevel' => CONTEXT_SYSTEM,
1023 'legacy' => array(
1024 'teacher' => CAP_ALLOW,
1025 'editingteacher' => CAP_ALLOW,
1026 'admin' => CAP_ALLOW
1027 )
1028 ),
1029
1030 'moodle/notes:manage' => array(
1031 'captype' => 'write',
1032 'contextlevel' => CONTEXT_SYSTEM,
1033 'legacy' => array(
1034 'teacher' => CAP_ALLOW,
1035 'editingteacher' => CAP_ALLOW,
1036 'admin' => CAP_ALLOW
1037 )
1038 ),
bbbf2d40 1039);
1040
1041?>