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