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