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