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