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