Updated the HEAD build version to 20100307
[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
68c52526 443 'moodle/role:override' => array(
eef868d1 444
bcdb0f19 445 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
446
68c52526 447 'captype' => 'write',
f432bebf 448 'contextlevel' => CONTEXT_COURSE,
68c52526 449 'legacy' => array(
bbbf2d40 450 'admin' => CAP_ALLOW
451 )
452 ),
eef868d1 453
3a0c6cca 454 'moodle/role:safeoverride' => array(
455
456 'riskbitmask' => RISK_SPAM,
457
458 'captype' => 'write',
f432bebf 459 'contextlevel' => CONTEXT_COURSE,
3a0c6cca 460 'legacy' => array(
461 'editingteacher' => CAP_ALLOW
462 )
463 ),
464
bbbf2d40 465 'moodle/role:manage' => array(
eef868d1 466
bcdb0f19 467 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
468
bbbf2d40 469 'captype' => 'write',
470 'contextlevel' => CONTEXT_SYSTEM,
471 'legacy' => array(
bbbf2d40 472 'admin' => CAP_ALLOW
473 )
474 ),
f43ce1ad 475
476 'moodle/role:unassignself' => array(
bcdb0f19 477
f43ce1ad 478 'captype' => 'write',
f432bebf 479 'contextlevel' => CONTEXT_COURSE,
f43ce1ad 480 'legacy' => array(
2d5a4f25 481 'student' => (empty($CFG->allowunenrol)) ? CAP_INHERIT : CAP_ALLOW,
f43ce1ad 482 'teacher' => CAP_ALLOW,
483 'editingteacher' => CAP_ALLOW,
484 'coursecreator' => CAP_ALLOW,
485 'admin' => CAP_ALLOW
486 )
487 ),
99f9cb51 488
489 'moodle/role:viewhiddenassigns' => array(
bcdb0f19 490
99f9cb51 491 'captype' => 'read',
f432bebf 492 'contextlevel' => CONTEXT_COURSE,
99f9cb51 493 'legacy' => array(
99f9cb51 494 'teacher' => CAP_ALLOW,
495 'editingteacher' => CAP_ALLOW,
99f9cb51 496 'admin' => CAP_ALLOW
497 )
498 ),
eef868d1 499
20dd4cf5 500 'moodle/role:switchroles' => array(
bcdb0f19 501
3a0c6cca 502 'riskbitmask' => RISK_XSS | RISK_PERSONAL,
bcdb0f19 503
20dd4cf5 504 'captype' => 'read',
f432bebf 505 'contextlevel' => CONTEXT_COURSE,
20dd4cf5 506 'legacy' => array(
20dd4cf5 507 'editingteacher' => CAP_ALLOW,
20dd4cf5 508 'admin' => CAP_ALLOW
509 )
510 ),
511
8ed5dd63 512 // Create, update and delete course categories. (Deleting a course category
513 // does not let you delete the courses it contains, unless you also have
514 // moodle/course: delete.) Creating and deleting requires this permission in
515 // the parent category.
516 'moodle/category:manage' => array(
eef868d1 517
89a792ab 518 'riskbitmask' => RISK_XSS,
519
bbbf2d40 520 'captype' => 'write',
521 'contextlevel' => CONTEXT_COURSECAT,
522 'legacy' => array(
bbbf2d40 523 'admin' => CAP_ALLOW
8ed5dd63 524 ),
525 'clonepermissionsfrom' => 'moodle/category:update'
bbbf2d40 526 ),
eef868d1 527
8ed5dd63 528 'moodle/category:viewhiddencategories' => array(
eef868d1 529
8ed5dd63 530 'captype' => 'read',
bbbf2d40 531 'contextlevel' => CONTEXT_COURSECAT,
532 'legacy' => array(
8ed5dd63 533 'coursecreator' => CAP_ALLOW,
bbbf2d40 534 'admin' => CAP_ALLOW
8ed5dd63 535 ),
536 'clonepermissionsfrom' => 'moodle/category:visibility'
bbbf2d40 537 ),
eef868d1 538
bbbf2d40 539 'moodle/course:create' => array(
eef868d1 540
21b6db6e 541 'riskbitmask' => RISK_XSS,
542
bbbf2d40 543 'captype' => 'write',
5e992f56 544 'contextlevel' => CONTEXT_COURSECAT,
bbbf2d40 545 'legacy' => array(
4473252d 546 'coursecreator' => CAP_ALLOW,
bbbf2d40 547 'admin' => CAP_ALLOW
548 )
549 ),
eef868d1 550
e452210a 551 'moodle/course:request' => array(
552 'captype' => 'write',
553 'contextlevel' => CONTEXT_SYSTEM,
554 'legacy' => array(
555 'user' => CAP_ALLOW,
556 )
557 ),
558
bbbf2d40 559 'moodle/course:delete' => array(
eef868d1 560
3a0c6cca 561 'riskbitmask' => RISK_DATALOSS,
562
bbbf2d40 563 'captype' => 'write',
564 'contextlevel' => CONTEXT_COURSE,
565 'legacy' => array(
9136a60c 566 'editingteacher' => CAP_ALLOW,
bbbf2d40 567 'admin' => CAP_ALLOW
568 )
569 ),
eef868d1 570
bbbf2d40 571 'moodle/course:update' => array(
eef868d1 572
21b6db6e 573 'riskbitmask' => RISK_XSS,
574
bbbf2d40 575 'captype' => 'write',
576 'contextlevel' => CONTEXT_COURSE,
577 'legacy' => array(
bbbf2d40 578 'editingteacher' => CAP_ALLOW,
bbbf2d40 579 'admin' => CAP_ALLOW
580 )
581 ),
eef868d1 582
bbbf2d40 583 'moodle/course:view' => array(
eef868d1 584
bbbf2d40 585 'captype' => 'read',
586 'contextlevel' => CONTEXT_COURSE,
587 'legacy' => array(
b0f55230 588 'guest' => CAP_ALLOW,
bbbf2d40 589 'student' => CAP_ALLOW,
590 'teacher' => CAP_ALLOW,
72cf2e39 591 'editingteacher' => CAP_ALLOW
bbbf2d40 592 )
593 ),
eef868d1 594
77c645df 595 'moodle/course:bulkmessaging' => array(
596
597 'riskbitmask' => RISK_SPAM,
598
599 'captype' => 'write',
600 'contextlevel' => CONTEXT_COURSE,
601 'legacy' => array(
77c645df 602 'teacher' => CAP_ALLOW,
603 'editingteacher' => CAP_ALLOW,
77c645df 604 'admin' => CAP_ALLOW
605 )
606 ),
607
1c45e42e 608 'moodle/course:viewhiddenuserfields' => array(
eef868d1 609
21b6db6e 610 'riskbitmask' => RISK_PERSONAL,
4e781c7b 611
612 'captype' => 'read',
613 'contextlevel' => CONTEXT_COURSE,
614 'legacy' => array(
615 'teacher' => CAP_ALLOW,
616 'editingteacher' => CAP_ALLOW,
617 'admin' => CAP_ALLOW
618 )
619 ),
620
1c45e42e 621 'moodle/course:viewhiddencourses' => array(
eef868d1 622
1c45e42e 623 'captype' => 'read',
624 'contextlevel' => CONTEXT_COURSE,
625 'legacy' => array(
2f5ab42b 626 'coursecreator' => CAP_ALLOW,
627 'teacher' => CAP_ALLOW,
628 'editingteacher' => CAP_ALLOW,
a5b8be62 629 'admin' => CAP_ALLOW
1c45e42e 630 )
631 ),
eef868d1 632
bbbf2d40 633 'moodle/course:visibility' => array(
eef868d1 634
bbbf2d40 635 'captype' => 'write',
636 'contextlevel' => CONTEXT_COURSE,
637 'legacy' => array(
bbbf2d40 638 'admin' => CAP_ALLOW
639 )
640 ),
eef868d1 641
a028c291 642 'moodle/course:managefiles' => array(
eef868d1 643
21b6db6e 644 'riskbitmask' => RISK_XSS,
645
a028c291 646 'captype' => 'write',
647 'contextlevel' => CONTEXT_COURSE,
648 'legacy' => array(
a028c291 649 'editingteacher' => CAP_ALLOW,
a028c291 650 'admin' => CAP_ALLOW
651 )
652 ),
eef868d1 653
bbbf2d40 654 'moodle/course:manageactivities' => array(
eef868d1 655
21b6db6e 656 'riskbitmask' => RISK_XSS,
657
bbbf2d40 658 'captype' => 'write',
659 'contextlevel' => CONTEXT_COURSE,
660 'legacy' => array(
bbbf2d40 661 'editingteacher' => CAP_ALLOW,
bbbf2d40 662 'admin' => CAP_ALLOW
663 )
664 ),
eef868d1 665
b79da3ac 666 'moodle/course:managemetacourse' => array(
eef868d1 667
3a0c6cca 668 'riskbitmask' => RISK_XSS | RISK_PERSONAL,
669
4b7aaf40 670 'captype' => 'write',
671 'contextlevel' => CONTEXT_COURSE,
672 'legacy' => array(
4b7aaf40 673 'editingteacher' => CAP_ALLOW,
4b7aaf40 674 'admin' => CAP_ALLOW
675 )
676 ),
eef868d1 677
bbbf2d40 678 'moodle/course:activityvisibility' => array(
eef868d1 679
bbbf2d40 680 'captype' => 'write',
681 'contextlevel' => CONTEXT_COURSE,
682 'legacy' => array(
bbbf2d40 683 'editingteacher' => CAP_ALLOW,
bbbf2d40 684 'admin' => CAP_ALLOW
685 )
686 ),
eef868d1 687
bbbf2d40 688 'moodle/course:viewhiddenactivities' => array(
eef868d1 689
bbbf2d40 690 'captype' => 'write',
691 'contextlevel' => CONTEXT_COURSE,
692 'legacy' => array(
bbbf2d40 693 'teacher' => CAP_ALLOW,
694 'editingteacher' => CAP_ALLOW,
bbbf2d40 695 'admin' => CAP_ALLOW
696 )
697 ),
eef868d1 698
bbbf2d40 699 'moodle/course:viewparticipants' => array(
eef868d1 700
bbbf2d40 701 'captype' => 'read',
702 'contextlevel' => CONTEXT_COURSE,
703 'legacy' => array(
bbbf2d40 704 'student' => CAP_ALLOW,
705 'teacher' => CAP_ALLOW,
706 'editingteacher' => CAP_ALLOW,
bbbf2d40 707 'admin' => CAP_ALLOW
165088f6 708 )
709 ),
f7c0d84b 710
711 'moodle/course:changefullname' => array(
712
cd7f72c0 713 'riskbitmask' => RISK_XSS,
714
f7c0d84b 715 'captype' => 'write',
716 'contextlevel' => CONTEXT_COURSE,
717 'legacy' => array(
718 'editingteacher' => CAP_ALLOW,
719 'admin' => CAP_ALLOW
5e99b9d7 720 ),
721 'clonepermissionsfrom' => 'moodle/course:update'
f7c0d84b 722 ),
723
724 'moodle/course:changeshortname' => 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:changeidnumber' => 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 ),
50569ba3 749 'moodle/course:changecategory' => array(
750 'riskbitmask' => RISK_XSS,
751
752 'captype' => 'write',
753 'contextlevel' => CONTEXT_COURSE,
754 'legacy' => array(
755 'editingteacher' => CAP_ALLOW,
756 'admin' => CAP_ALLOW
757 ),
758 'clonepermissionsfrom' => 'moodle/course:update'
759 ),
760
761 'moodle/course:changesummary' => array(
762 'riskbitmask' => RISK_XSS,
763
764 'captype' => 'write',
765 'contextlevel' => CONTEXT_COURSE,
766 'legacy' => array(
767 'editingteacher' => CAP_ALLOW,
768 'admin' => CAP_ALLOW
769 ),
770 'clonepermissionsfrom' => 'moodle/course:update'
771 ),
772
f7c0d84b 773
165088f6 774 'moodle/site:viewparticipants' => array(
775
776 'captype' => 'read',
777 'contextlevel' => CONTEXT_SYSTEM,
778 'legacy' => array(
779 'admin' => CAP_ALLOW
bbbf2d40 780 )
781 ),
eef868d1 782
bbbf2d40 783 'moodle/course:viewscales' => array(
eef868d1 784
bbbf2d40 785 'captype' => 'read',
786 'contextlevel' => CONTEXT_COURSE,
787 'legacy' => array(
bbbf2d40 788 'student' => CAP_ALLOW,
789 'teacher' => CAP_ALLOW,
790 'editingteacher' => CAP_ALLOW,
bbbf2d40 791 'admin' => CAP_ALLOW
792 )
793 ),
eef868d1 794
bbbf2d40 795 'moodle/course:managescales' => array(
eef868d1 796
bbbf2d40 797 'captype' => 'write',
798 'contextlevel' => CONTEXT_COURSE,
799 'legacy' => array(
bbbf2d40 800 'editingteacher' => CAP_ALLOW,
bbbf2d40 801 'admin' => CAP_ALLOW
802 )
803 ),
eef868d1 804
bbbf2d40 805 'moodle/course:managegroups' => array(
806
807 'captype' => 'write',
808 'contextlevel' => CONTEXT_COURSE,
a028c291 809 'legacy' => array(
a028c291 810 'editingteacher' => CAP_ALLOW,
a028c291 811 'admin' => CAP_ALLOW
812 )
813 ),
eef868d1 814
a028c291 815 'moodle/course:reset' => array(
816
3a0c6cca 817 'riskbitmask' => RISK_DATALOSS,
818
a028c291 819 'captype' => 'write',
820 'contextlevel' => CONTEXT_COURSE,
bbbf2d40 821 'legacy' => array(
bbbf2d40 822 'editingteacher' => CAP_ALLOW,
bbbf2d40 823 'admin' => CAP_ALLOW
824 )
825 ),
eef868d1 826
bbbf2d40 827 'moodle/blog:view' => array(
828
829 'captype' => 'read',
05de723b
NC
830 'contextlevel' => CONTEXT_SYSTEM,
831 'legacy' => array(
832 'guest' => CAP_ALLOW,
833 'user' => CAP_ALLOW,
834 'student' => CAP_ALLOW,
835 'teacher' => CAP_ALLOW,
836 'editingteacher' => CAP_ALLOW,
837 'admin' => CAP_ALLOW
838 )
839 ),
840
841 'moodle/blog:search' => array(
842 'captype' => 'read',
843 'contextlevel' => CONTEXT_SYSTEM,
bbbf2d40 844 'legacy' => array(
00adf177 845 'guest' => CAP_ALLOW,
c785d40a 846 'user' => CAP_ALLOW,
bbbf2d40 847 'student' => CAP_ALLOW,
848 'teacher' => CAP_ALLOW,
849 'editingteacher' => CAP_ALLOW,
bbbf2d40 850 'admin' => CAP_ALLOW
851 )
852 ),
eef868d1 853
05de723b
NC
854 'moodle/blog:viewdrafts' => array(
855
856 'riskbitmask' => RISK_PERSONAL,
857 'captype' => 'read',
858 'contextlevel' => CONTEXT_SYSTEM,
859 'legacy' => array(
860 'admin' => CAP_ALLOW
861 )
862 ),
863
5a8ab2e9 864 'moodle/blog:create' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 865
21b6db6e 866 'riskbitmask' => RISK_SPAM,
867
bbbf2d40 868 'captype' => 'write',
869 'contextlevel' => CONTEXT_SYSTEM,
870 'legacy' => array(
c785d40a 871 'user' => CAP_ALLOW,
bbbf2d40 872 'admin' => CAP_ALLOW
873 )
874 ),
eef868d1 875
bbbf2d40 876 'moodle/blog:manageentries' => array(
877
21b6db6e 878 'riskbitmask' => RISK_SPAM,
879
bbbf2d40 880 'captype' => 'write',
05de723b 881 'contextlevel' => CONTEXT_SYSTEM,
bbbf2d40 882 'legacy' => array(
bbbf2d40 883 'teacher' => CAP_ALLOW,
884 'editingteacher' => CAP_ALLOW,
bbbf2d40 885 'admin' => CAP_ALLOW
886 )
887 ),
05de723b 888
cae83708 889 'moodle/blog:manageexternal' => array(
890
891 'riskbitmask' => RISK_SPAM,
892
893 'captype' => 'write',
894 'contextlevel' => CONTEXT_USER,
895 'legacy' => array(
896 'student' => CAP_ALLOW,
897 'user' => CAP_ALLOW,
898 'teacher' => CAP_ALLOW,
899 'editingteacher' => CAP_ALLOW,
900 'admin' => CAP_ALLOW
901 )
902 ),
903
05de723b
NC
904 'moodle/blog:associatecourse' => array(
905
906 'captype' => 'write',
907 'contextlevel' => CONTEXT_COURSE,
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
917 'moodle/blog:associatemodule' => array(
918
919 'captype' => 'write',
920 'contextlevel' => CONTEXT_MODULE,
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 ),
eef868d1 929
5a8ab2e9 930 'moodle/calendar:manageownentries' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 931
21b6db6e 932 'riskbitmask' => RISK_SPAM,
933
bbbf2d40 934 'captype' => 'write',
f432bebf 935 'contextlevel' => CONTEXT_COURSE,
bbbf2d40 936 'legacy' => array(
c785d40a 937 'user' => CAP_ALLOW,
bbbf2d40 938 'admin' => CAP_ALLOW
939 )
940 ),
eef868d1 941
f63d2922 942 'moodle/calendar:managegroupentries' => array(
943
944 'riskbitmask' => RISK_SPAM,
945
946 'captype' => 'write',
f432bebf 947 'contextlevel' => CONTEXT_COURSE,
f63d2922 948 'legacy' => array(
949 'teacher' => CAP_ALLOW,
950 'editingteacher' => CAP_ALLOW,
951 'admin' => CAP_ALLOW
952 )
953 ),
954
bbbf2d40 955 'moodle/calendar:manageentries' => array(
956
21b6db6e 957 'riskbitmask' => RISK_SPAM,
958
bbbf2d40 959 'captype' => 'write',
f432bebf 960 'contextlevel' => CONTEXT_COURSE,
bbbf2d40 961 'legacy' => array(
bbbf2d40 962 'teacher' => CAP_ALLOW,
963 'editingteacher' => CAP_ALLOW,
bbbf2d40 964 'admin' => CAP_ALLOW
965 )
77d4953e 966 ),
a044c05d 967
968 'moodle/user:editprofile' => array(
969
3a0c6cca 970 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
a044c05d 971
972 'captype' => 'write',
973 'contextlevel' => CONTEXT_USER,
974 'legacy' => array(
975 'admin' => CAP_ALLOW
976 )
977 ),
eef868d1 978
a5b8be62 979 'moodle/user:editownprofile' => array(
1cb3da36 980
3a0c6cca 981 'riskbitmask' => RISK_SPAM,
982
a5b8be62 983 'captype' => 'write',
984 'contextlevel' => CONTEXT_SYSTEM,
985 'legacy' => array(
1cb3da36 986 'guest' => CAP_PROHIBIT,
987 'user' => CAP_ALLOW,
988 'admin' => CAP_ALLOW
a5b8be62 989 )
1cb3da36 990 ),
991
a5b8be62 992 'moodle/user:changeownpassword' => array(
1cb3da36 993
a5b8be62 994 'captype' => 'write',
995 'contextlevel' => CONTEXT_SYSTEM,
996 'legacy' => array(
1cb3da36 997 'guest' => CAP_PROHIBIT,
998 'user' => CAP_ALLOW,
999 'admin' => CAP_ALLOW
a5b8be62 1000 )
1cb3da36 1001 ),
1002
eef868d1 1003 // The next 3 might make no sense for some roles, e.g teacher, etc.
77d4953e 1004 // since the next level up is site. These are more for the parent role
1005 'moodle/user:readuserposts' => array(
bcdb0f19 1006
77d4953e 1007 'captype' => 'read',
4b10f08b 1008 'contextlevel' => CONTEXT_USER,
77d4953e 1009 'legacy' => array(
77d4953e 1010 'student' => CAP_ALLOW,
1011 'teacher' => CAP_ALLOW,
1012 'editingteacher' => CAP_ALLOW,
77d4953e 1013 'admin' => CAP_ALLOW
1014 )
1015 ),
eef868d1 1016
77d4953e 1017 'moodle/user:readuserblogs' => array(
bcdb0f19 1018
77d4953e 1019 'captype' => 'read',
4b10f08b 1020 'contextlevel' => CONTEXT_USER,
77d4953e 1021 'legacy' => array(
77d4953e 1022 'student' => CAP_ALLOW,
1023 'teacher' => CAP_ALLOW,
1024 'editingteacher' => CAP_ALLOW,
77d4953e 1025 'admin' => CAP_ALLOW
1026 )
1027 ),
eef868d1 1028
3c7da16d 1029 // designed for parent role - not used in legacy roles
77d4953e 1030 'moodle/user:viewuseractivitiesreport' => array(
3c7da16d 1031 'riskbitmask' => RISK_PERSONAL,
bcdb0f19 1032
77d4953e 1033 'captype' => 'read',
4b10f08b 1034 'contextlevel' => CONTEXT_USER,
77d4953e 1035 'legacy' => array(
77d4953e 1036 )
945f88ca 1037 ),
4e781c7b 1038
3b120e46 1039 //capabilities designed for the new message system configuration
1040 'moodle/user:editmessageprofile' => array(
f7c0d84b 1041
3b120e46 1042 'riskbitmask' => RISK_SPAM,
f7c0d84b 1043
3b120e46 1044 'captype' => 'write',
1045 'contextlevel' => CONTEXT_USER,
1046 'legacy' => array(
1047 'admin' => CAP_ALLOW
1048 )
1049 ),
f7c0d84b 1050
1051 'moodle/user:editownmessageprofile' => array(
1052
1053 'captype' => 'write',
1054 'contextlevel' => CONTEXT_SYSTEM,
1055 'legacy' => array(
3b120e46 1056 'guest' => CAP_PROHIBIT,
1057 'user' => CAP_ALLOW,
1058 'admin' => CAP_ALLOW
f7c0d84b 1059 )
3b120e46 1060 ),
eef868d1 1061
271e6dec 1062 'moodle/question:managecategory' => array(
14d701d6 1063 'riskbitmask' => RISK_SPAM | RISK_XSS,
945f88ca 1064 'captype' => 'write',
1065 'contextlevel' => CONTEXT_COURSE,
1066 'legacy' => array(
945f88ca 1067 'editingteacher' => CAP_ALLOW,
945f88ca 1068 'admin' => CAP_ALLOW
1069 )
a5b8be62 1070 ),
1071
271e6dec 1072 //new in moodle 1.9
1073 'moodle/question:add' => array(
14d701d6 1074 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1075 'captype' => 'write',
1076 'contextlevel' => CONTEXT_COURSE,
1077 'legacy' => array(
1078 'editingteacher' => CAP_ALLOW,
1079 'admin' => CAP_ALLOW
1080 ),
1081 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1082 ),
271e6dec 1083 'moodle/question:editmine' => array(
14d701d6 1084 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1085 'captype' => 'write',
1086 'contextlevel' => CONTEXT_COURSE,
1087 'legacy' => array(
1088 'editingteacher' => CAP_ALLOW,
1089 'admin' => CAP_ALLOW
1090 ),
a5b8be62 1091 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1092 ),
1093 'moodle/question:editall' => array(
14d701d6 1094 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1095 'captype' => 'write',
1096 'contextlevel' => CONTEXT_COURSE,
1097 'legacy' => array(
1098 'editingteacher' => CAP_ALLOW,
1099 'admin' => CAP_ALLOW
1100 ),
a5b8be62 1101 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1102 ),
1103 'moodle/question:viewmine' => array(
945f88ca 1104 'captype' => 'read',
1105 'contextlevel' => CONTEXT_COURSE,
1106 'legacy' => array(
945f88ca 1107 'editingteacher' => CAP_ALLOW,
945f88ca 1108 'admin' => CAP_ALLOW
271e6dec 1109 ),
a5b8be62 1110 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1111 ),
271e6dec 1112 'moodle/question:viewall' => array(
1113 'captype' => 'read',
1114 'contextlevel' => CONTEXT_COURSE,
1115 'legacy' => array(
1116 'editingteacher' => CAP_ALLOW,
1117 'admin' => CAP_ALLOW
1118 ),
a5b8be62 1119 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1120 ),
1121 'moodle/question:usemine' => array(
1122 'captype' => 'read',
1123 'contextlevel' => CONTEXT_COURSE,
1124 'legacy' => array(
1125 'editingteacher' => CAP_ALLOW,
1126 'admin' => CAP_ALLOW
1127 ),
a5b8be62 1128 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1129 ),
1130 'moodle/question:useall' => array(
1131 'captype' => 'read',
1132 'contextlevel' => CONTEXT_COURSE,
1133 'legacy' => array(
1134 'editingteacher' => CAP_ALLOW,
1135 'admin' => CAP_ALLOW
1136 ),
a5b8be62 1137 'clonepermissionsfrom' => 'moodle/question:manage'
1138 ),
271e6dec 1139 'moodle/question:movemine' => array(
945f88ca 1140 'captype' => 'write',
1141 'contextlevel' => CONTEXT_COURSE,
1142 'legacy' => array(
945f88ca 1143 'editingteacher' => CAP_ALLOW,
945f88ca 1144 'admin' => CAP_ALLOW
271e6dec 1145 ),
a5b8be62 1146 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1147 ),
271e6dec 1148 'moodle/question:moveall' => array(
945f88ca 1149 'captype' => 'write',
1150 'contextlevel' => CONTEXT_COURSE,
1151 'legacy' => array(
945f88ca 1152 'editingteacher' => CAP_ALLOW,
945f88ca 1153 'admin' => CAP_ALLOW
271e6dec 1154 ),
a5b8be62 1155 'clonepermissionsfrom' => 'moodle/question:manage'
7191a1fa 1156 ),
271e6dec 1157 //END new in moodle 1.9
a5b8be62 1158
0eb6b04a 1159 // Configure the installed question types.
1160 'moodle/question:config' => array(
0eb6b04a 1161 'riskbitmask' => RISK_CONFIG,
0eb6b04a 1162 'captype' => 'write',
1163 'contextlevel' => CONTEXT_SYSTEM,
1164 'legacy' => array(
1165 'admin' => CAP_ALLOW
1166 )
1167 ),
1168
62e76c67 1169 // While attempting questions, the ability to flag particular questions for later reference.
1170 'moodle/question:flag' => array(
1171 'captype' => 'write',
1172 'contextlevel' => CONTEXT_COURSE,
1173 'legacy' => array(
1174 'student' => CAP_ALLOW,
1175 'teacher' => CAP_ALLOW,
1176 'editingteacher' => CAP_ALLOW,
1177 'coursecreator' => CAP_ALLOW,
1178 'admin' => CAP_ALLOW
1179 )
1180 ),
bcdb0f19 1181
62e76c67 1182 'moodle/site:doclinks' => array(
7191a1fa 1183 'captype' => 'read',
1184 'contextlevel' => CONTEXT_SYSTEM,
1185 'legacy' => array(
7191a1fa 1186 'teacher' => CAP_ALLOW,
1187 'editingteacher' => CAP_ALLOW,
7191a1fa 1188 'admin' => CAP_ALLOW
1189 )
3924b988 1190 ),
eef868d1 1191
3924b988 1192 'moodle/course:sectionvisibility' => array(
bcdb0f19 1193
3924b988 1194 'captype' => 'write',
1195 'contextlevel' => CONTEXT_COURSE,
1196 'legacy' => array(
3924b988 1197 'editingteacher' => CAP_ALLOW,
3924b988 1198 'admin' => CAP_ALLOW
1199 )
1200 ),
eef868d1 1201
dc558690 1202 'moodle/course:useremail' => array(
bcdb0f19 1203
dc558690 1204 'captype' => 'write',
1205 'contextlevel' => CONTEXT_COURSE,
1206 'legacy' => array(
dc558690 1207 'editingteacher' => CAP_ALLOW,
dc558690 1208 'admin' => CAP_ALLOW
1209 )
1210 ),
eef868d1 1211
3924b988 1212 'moodle/course:viewhiddensections' => array(
bcdb0f19 1213
3924b988 1214 'captype' => 'write',
1215 'contextlevel' => CONTEXT_COURSE,
1216 'legacy' => array(
3924b988 1217 'editingteacher' => CAP_ALLOW,
3924b988 1218 'admin' => CAP_ALLOW
1219 )
1220 ),
eef868d1 1221
3924b988 1222 'moodle/course:setcurrentsection' => array(
bcdb0f19 1223
3924b988 1224 'captype' => 'write',
1225 'contextlevel' => CONTEXT_COURSE,
1226 'legacy' => array(
3924b988 1227 'editingteacher' => CAP_ALLOW,
3924b988 1228 'admin' => CAP_ALLOW
1229 )
1230 ),
eef868d1 1231
dd45888a 1232 'moodle/site:mnetlogintoremote' => array(
bc4c9800 1233
3924b988 1234 'captype' => 'read',
dd45888a 1235 'contextlevel' => CONTEXT_SYSTEM,
3924b988 1236 'legacy' => array(
3924b988 1237 'admin' => CAP_ALLOW
1238 )
1239 ),
eef868d1 1240
dd45888a 1241 'moodle/grade:viewall' => array(
bcdb0f19 1242 'riskbitmask' => RISK_PERSONAL,
dd45888a 1243 'captype' => 'read',
eecf76df 1244 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_USER
3924b988 1245 'legacy' => array(
dd45888a 1246 'teacher' => CAP_ALLOW,
3924b988 1247 'editingteacher' => CAP_ALLOW,
3924b988 1248 'admin' => CAP_ALLOW
dd45888a 1249 ),
1250 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
f509ce06 1251 ),
f43ce1ad 1252
dd45888a 1253 'moodle/grade:view' => array(
f509ce06 1254 'captype' => 'read',
eecf76df 1255 'contextlevel' => CONTEXT_COURSE,
f509ce06 1256 'legacy' => array(
dd45888a 1257 'student' => CAP_ALLOW
f509ce06 1258 )
ca9ffa18 1259 ),
dd45888a 1260
1261 'moodle/grade:viewhidden' => array(
ca9ffa18 1262 'riskbitmask' => RISK_PERSONAL,
1263 'captype' => 'read',
eecf76df 1264 'contextlevel' => CONTEXT_COURSE,
ca9ffa18 1265 'legacy' => array(
0371f8e5 1266 'teacher' => CAP_ALLOW,
1267 'editingteacher' => CAP_ALLOW,
1268 'admin' => CAP_ALLOW
dd45888a 1269 ),
1270 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
ca9ffa18 1271 ),
dd45888a 1272
1273 'moodle/grade:import' => array(
3a0c6cca 1274 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
dd45888a 1275 'captype' => 'write',
ca9ffa18 1276 'contextlevel' => CONTEXT_COURSE,
1277 'legacy' => array(
ca9ffa18 1278 'editingteacher' => CAP_ALLOW,
1279 'admin' => CAP_ALLOW
dd45888a 1280 ),
1281 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1282 ),
dd45888a 1283
1284 'moodle/grade:export' => array(
ca9ffa18 1285 'riskbitmask' => RISK_PERSONAL,
1286 'captype' => 'read',
1287 'contextlevel' => CONTEXT_COURSE,
1288 'legacy' => array(
1289 'teacher' => CAP_ALLOW,
1290 'editingteacher' => CAP_ALLOW,
1291 'admin' => CAP_ALLOW
dd45888a 1292 ),
1293 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1294 ),
dd45888a 1295
1296 'moodle/grade:manage' => array(
3a0c6cca 1297 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
dd45888a 1298 'captype' => 'write',
1299 'contextlevel' => CONTEXT_COURSE,
ca9ffa18 1300 'legacy' => array(
dd45888a 1301 'editingteacher' => CAP_ALLOW,
ca9ffa18 1302 'admin' => CAP_ALLOW
dd45888a 1303 ),
1304 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1305 ),
dd45888a 1306
a5b8be62 1307 'moodle/grade:edit' => array(
1308 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
04259694 1309 'captype' => 'write',
1310 'contextlevel' => CONTEXT_COURSE,
1311 'legacy' => array(
1312 'editingteacher' => CAP_ALLOW,
1313 'admin' => CAP_ALLOW
1314 ),
1315 'clonepermissionsfrom' => 'moodle/course:managegrades'
1316 ),
1317
a5b8be62 1318 'moodle/grade:manageoutcomes' => array(
284abb09 1319 'captype' => 'write',
1320 'contextlevel' => CONTEXT_COURSE,
1321 'legacy' => array(
1322 'editingteacher' => CAP_ALLOW,
1323 'admin' => CAP_ALLOW
1324 ),
1325 'clonepermissionsfrom' => 'moodle/course:managegrades'
1326 ),
1327
1328 'moodle/grade:manageletters' => array(
ca9ffa18 1329 'captype' => 'write',
1330 'contextlevel' => CONTEXT_COURSE,
1331 'legacy' => array(
1332 'editingteacher' => CAP_ALLOW,
1333 'admin' => CAP_ALLOW
a5b8be62 1334 ),
1335 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1336 ),
dd45888a 1337
a5b8be62 1338 'moodle/grade:hide' => array(
ca9ffa18 1339 'captype' => 'write',
1340 'contextlevel' => CONTEXT_COURSE,
1341 'legacy' => array(
1342 'editingteacher' => CAP_ALLOW,
1343 'admin' => CAP_ALLOW
1344 )
1345 ),
dd45888a 1346
a5b8be62 1347 'moodle/grade:lock' => array(
dd45888a 1348 'captype' => 'write',
ca9ffa18 1349 'contextlevel' => CONTEXT_COURSE,
1350 'legacy' => array(
1351 'editingteacher' => CAP_ALLOW,
1352 'admin' => CAP_ALLOW
1353 )
1354 ),
dd45888a 1355
a5b8be62 1356 'moodle/grade:unlock' => array(
ca9ffa18 1357 'captype' => 'write',
1358 'contextlevel' => CONTEXT_COURSE,
1359 'legacy' => array(
1360 'editingteacher' => CAP_ALLOW,
1361 'admin' => CAP_ALLOW
1362 )
282c1695 1363 ),
dd45888a 1364
1365 'moodle/my:manageblocks' => array(
282c1695 1366 'captype' => 'write',
1367 'contextlevel' => CONTEXT_SYSTEM,
1368 'legacy' => array(
1369 'user' => CAP_ALLOW
1370 )
eca3af25 1371 ),
dd45888a 1372
eca3af25 1373 'moodle/notes:view' => array(
1374 'captype' => 'read',
f432bebf 1375 'contextlevel' => CONTEXT_COURSE,
eca3af25 1376 'legacy' => array(
1377 'teacher' => CAP_ALLOW,
1378 'editingteacher' => CAP_ALLOW,
1379 'admin' => CAP_ALLOW
1380 )
1381 ),
1382
1383 'moodle/notes:manage' => array(
3a0c6cca 1384 'riskbitmask' => RISK_SPAM,
1385
eca3af25 1386 'captype' => 'write',
f432bebf 1387 'contextlevel' => CONTEXT_COURSE,
eca3af25 1388 'legacy' => array(
1389 'teacher' => CAP_ALLOW,
1390 'editingteacher' => CAP_ALLOW,
1391 'admin' => CAP_ALLOW
1392 )
dd45888a 1393 ),
79642064 1394
1395 'moodle/tag:manage' => array(
3a0c6cca 1396 'riskbitmask' => RISK_SPAM,
1397
79642064 1398 'captype' => 'write',
1399 'contextlevel' => CONTEXT_SYSTEM,
1400 'legacy' => array(
1401 'teacher' => CAP_ALLOW,
1402 'editingteacher' => CAP_ALLOW,
1403 'admin' => CAP_ALLOW
1404 )
705789bd 1405 ),
1406
1407 'moodle/tag:create' => array(
3a0c6cca 1408 'riskbitmask' => RISK_SPAM,
1409
705789bd 1410 'captype' => 'write',
1411 'contextlevel' => CONTEXT_SYSTEM,
1412 'legacy' => array(
0f07c40e 1413 'admin' => CAP_ALLOW,
1414 'user' => CAP_ALLOW
705789bd 1415 )
1416 ),
a5b8be62 1417
705789bd 1418 'moodle/tag:edit' => array(
3a0c6cca 1419 'riskbitmask' => RISK_SPAM,
1420
705789bd 1421 'captype' => 'write',
1422 'contextlevel' => CONTEXT_SYSTEM,
1423 'legacy' => array(
3e6e529f 1424 'admin' => CAP_ALLOW,
1425 'user' => CAP_ALLOW
98b5789d 1426 )
1427 ),
a5b8be62 1428
98b5789d 1429 'moodle/tag:editblocks' => array(
1430 'captype' => 'write',
1431 'contextlevel' => CONTEXT_SYSTEM,
1432 'legacy' => array(
705789bd 1433 'teacher' => CAP_ALLOW,
1434 'editingteacher' => CAP_ALLOW,
1435 'admin' => CAP_ALLOW
1436 )
7e874772 1437 ),
1438
1439 'moodle/block:view' => array(
1440 'captype' => 'read',
1441 'contextlevel' => CONTEXT_BLOCK,
1442 'legacy' => array(
1443 'guest' => CAP_ALLOW,
25a7d980 1444 'user' => CAP_ALLOW,
1445 'student' => CAP_ALLOW,
1446 'teacher' => CAP_ALLOW,
1447 'editingteacher' => CAP_ALLOW,
1448 'coursecreator' => CAP_ALLOW
7e874772 1449 )
8512f577 1450 ),
1451
d14edf06 1452 'moodle/block:edit' => array(
1453 'riskbitmask' => RISK_SPAM | RISK_XSS,
1454
1455 'captype' => 'write',
1456 'contextlevel' => CONTEXT_BLOCK,
1457 'legacy' => array(
1458 'editingteacher' => CAP_ALLOW,
1459 'coursecreator' => CAP_ALLOW
1460 )
1461 ),
1462
8512f577 1463 'moodle/portfolio:export' => array(
1464 'captype' => 'read',
1465 'contextlevel' => CONTEXT_SYSTEM,
1466 'legacy' => array(
1467 'user' => CAP_ALLOW,
1468 'student' => CAP_ALLOW,
1469 'teacher' => CAP_ALLOW,
1470 'editingteacher' => CAP_ALLOW,
1471 'coursecreator' => CAP_ALLOW
1472 )
1bcb7eb5 1473 ),
1474 'moodle/comment:view' => array(
1475
1476 'captype' => 'read',
1477 'contextlevel' => CONTEXT_SYSTEM,
1478 'legacy' => array(
1479 'user' => CAP_ALLOW,
1480 'student' => CAP_ALLOW,
1481 'teacher' => CAP_ALLOW,
1482 'editingteacher' => CAP_ALLOW,
1483 'coursecreator' => CAP_ALLOW,
1484 'admin' => CAP_ALLOW
1485 )
1486 ),
1487 'moodle/comment:post' => array(
1488
1489 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
1490 'captype' => 'write',
1491 'contextlevel' => CONTEXT_SYSTEM,
1492 'legacy' => array(
1493 'user' => CAP_ALLOW,
1494 'student' => CAP_ALLOW,
1495 'teacher' => CAP_ALLOW,
1496 'editingteacher' => CAP_ALLOW,
1497 'coursecreator' => CAP_ALLOW,
1498 'admin' => CAP_ALLOW
1499 )
1500 ),
1501 'moodle/comment:delete' => array(
1502
1503 'riskbitmask' => RISK_DATALOSS,
1504 'captype' => 'write',
1505 'contextlevel' => CONTEXT_SYSTEM,
1506 'legacy' => array(
1507 'editingteacher' => CAP_ALLOW,
1508 'coursecreator' => CAP_ALLOW,
1509 'admin' => CAP_ALLOW
1510 )
5eacbd4b 1511 ),
1512 'moodle/webservice:createtoken' => array(
1513
52dd27bf 1514 'riskbitmask' => RISK_CONFIG | RISK_DATALOSS | RISK_SPAM | RISK_PERSONAL | RISK_XSS,
5eacbd4b 1515 'captype' => 'write',
1516 'contextlevel' => CONTEXT_SYSTEM,
1517 'legacy' => array(
1518 'admin' => CAP_ALLOW
1519 )
79642064 1520 )
bbbf2d40 1521);