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