MDL-9511 adding/renaming grading capabilities
[moodle.git] / lib / db / access.php
CommitLineData
bbbf2d40 1<?php
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
a6b02b65 38 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
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
a6b02b65 94 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
bcdb0f19 95
bbbf2d40 96 'captype' => 'legacy',
97 'contextlevel' => CONTEXT_SYSTEM
98 ),
eef868d1 99
100
bbbf2d40 101 'moodle/site:config' => array(
eef868d1 102
a6b02b65 103 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
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 ),
eef868d1 123
51792df0 124 'moodle/site:approvecourse' => array(
eef868d1 125
bcdb0f19 126 'riskbitmask' => RISK_XSS,
127
51792df0 128 'captype' => 'write',
129 'contextlevel' => CONTEXT_SYSTEM,
130 'legacy' => array(
51792df0 131 'admin' => CAP_ALLOW
132 )
133 ),
eef868d1 134
bbbf2d40 135 'moodle/site:import' => array(
eef868d1 136
21b6db6e 137 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
138
bbbf2d40 139 'captype' => 'write',
140 'contextlevel' => CONTEXT_SYSTEM,
141 'legacy' => array(
a028c291 142 'editingteacher' => CAP_ALLOW,
bbbf2d40 143 'admin' => CAP_ALLOW
144 )
145 ),
eef868d1 146
bbbf2d40 147 'moodle/site:backup' => array(
eef868d1 148
21b6db6e 149 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
150
bbbf2d40 151 'captype' => 'write',
152 'contextlevel' => CONTEXT_SYSTEM,
153 'legacy' => array(
7246585a 154 'editingteacher' => CAP_ALLOW,
bbbf2d40 155 'admin' => CAP_ALLOW
156 )
157 ),
eef868d1 158
bbbf2d40 159 'moodle/site:restore' => array(
eef868d1 160
21b6db6e 161 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
162
bbbf2d40 163 'captype' => 'write',
164 'contextlevel' => CONTEXT_SYSTEM,
165 'legacy' => array(
7246585a 166 'editingteacher' => CAP_ALLOW,
bbbf2d40 167 'admin' => CAP_ALLOW
168 )
169 ),
eef868d1 170
bbbf2d40 171 'moodle/site:manageblocks' => array(
eef868d1 172
21b6db6e 173 'riskbitmask' => RISK_SPAM | RISK_XSS,
174
bbbf2d40 175 'captype' => 'write',
176 'contextlevel' => CONTEXT_SYSTEM,
177 'legacy' => array(
73b73d21 178 'editingteacher' => CAP_ALLOW,
bbbf2d40 179 'admin' => CAP_ALLOW
180 )
181 ),
eef868d1 182
27950688 183 'moodle/site:accessallgroups' => array(
eef868d1 184
27950688 185 'captype' => 'read',
186 'contextlevel' => CONTEXT_SYSTEM,
187 'legacy' => array(
27950688 188 'teacher' => CAP_ALLOW,
189 'editingteacher' => CAP_ALLOW,
27950688 190 'admin' => CAP_ALLOW
191 )
192 ),
eef868d1 193
53d7785b 194 'moodle/site:viewfullnames' => array(
eef868d1 195
53d7785b 196 'captype' => 'read',
197 'contextlevel' => CONTEXT_SYSTEM,
198 'legacy' => array(
53d7785b 199 'teacher' => CAP_ALLOW,
200 'editingteacher' => CAP_ALLOW,
53d7785b 201 'admin' => CAP_ALLOW
202 )
203 ),
eef868d1 204
a028c291 205 'moodle/site:viewreports' => array(
eef868d1 206
21b6db6e 207 'riskbitmask' => RISK_PERSONAL,
208
a028c291 209 'captype' => 'read',
77d4953e 210 'contextlevel' => CONTEXT_SYSTEM,
a028c291 211 'legacy' => array(
a028c291 212 'teacher' => CAP_ALLOW,
213 'editingteacher' => CAP_ALLOW,
a028c291 214 'admin' => CAP_ALLOW
215 )
216 ),
eef868d1 217
7d8a3cb0 218 'moodle/site:trustcontent' => array(
eef868d1 219
21b6db6e 220 'riskbitmask' => RISK_XSS,
221
7d8a3cb0 222 'captype' => 'write',
223 'contextlevel' => CONTEXT_SYSTEM,
224 'legacy' => array(
7d8a3cb0 225 'editingteacher' => CAP_ALLOW,
7d8a3cb0 226 'admin' => CAP_ALLOW
227 )
228 ),
eef868d1 229
6df3c7df 230 'moodle/site:uploadusers' => array(
eef868d1 231
21b6db6e 232 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
233
bbbf2d40 234 'captype' => 'write',
235 'contextlevel' => CONTEXT_SYSTEM,
236 'legacy' => array(
bbbf2d40 237 'admin' => CAP_ALLOW
238 )
239 ),
eef868d1 240
6df3c7df 241
242 'moodle/user:create' => array(
243
244 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
eef868d1 245
bbbf2d40 246 'captype' => 'write',
247 'contextlevel' => CONTEXT_SYSTEM,
248 'legacy' => array(
bbbf2d40 249 'admin' => CAP_ALLOW
250 )
251 ),
eef868d1 252
6df3c7df 253 'moodle/user:delete' => array(
cc891abe 254
bcdb0f19 255 'riskbitmask' => RISK_PERSONAL,
256
cc891abe 257 'captype' => 'write',
258 'contextlevel' => CONTEXT_SYSTEM,
259 'legacy' => array(
cc891abe 260 'admin' => CAP_ALLOW
261 )
262 ),
263
6df3c7df 264 'moodle/user:update' => array(
cc891abe 265
266 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
21b6db6e 267
bbbf2d40 268 'captype' => 'write',
269 'contextlevel' => CONTEXT_SYSTEM,
270 'legacy' => array(
bbbf2d40 271 'admin' => CAP_ALLOW
272 )
273 ),
eef868d1 274
bbbf2d40 275 'moodle/user:viewdetails' => array(
eef868d1 276
e58eca72 277 'captype' => 'read',
bbbf2d40 278 'contextlevel' => CONTEXT_SYSTEM,
279 'legacy' => array(
22ae509e 280 'guest' => CAP_ALLOW,
281 'student' => CAP_ALLOW,
282 'teacher' => CAP_ALLOW,
283 'editingteacher' => CAP_ALLOW,
bbbf2d40 284 'admin' => CAP_ALLOW
285 )
286 ),
e58eca72 287
288 'moodle/user:viewhiddendetails' => array(
eef868d1 289
21b6db6e 290 'riskbitmask' => RISK_PERSONAL,
291
e58eca72 292 'captype' => 'read',
293 'contextlevel' => CONTEXT_SYSTEM,
294 'legacy' => array(
e58eca72 295 'teacher' => CAP_ALLOW,
296 'editingteacher' => CAP_ALLOW,
e58eca72 297 'admin' => CAP_ALLOW
298 )
299 ),
eef868d1 300
6c95827f 301 'moodle/user:loginas' => array(
302
303 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
304
305 'captype' => 'write',
306 'contextlevel' => CONTEXT_COURSE,
307 'legacy' => array(
6c95827f 308 'admin' => CAP_ALLOW
309 )
310 ),
311
bbbf2d40 312 'moodle/role:assign' => array(
eef868d1 313
bbbf2d40 314 'captype' => 'write',
315 'contextlevel' => CONTEXT_SYSTEM,
316 'legacy' => array(
861fdcaa 317 'editingteacher' => CAP_ALLOW,
68c52526 318 'admin' => CAP_ALLOW
319 )
320 ),
eef868d1 321
68c52526 322 'moodle/role:override' => array(
eef868d1 323
bcdb0f19 324 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
325
68c52526 326 'captype' => 'write',
327 'contextlevel' => CONTEXT_SYSTEM,
328 'legacy' => array(
bbbf2d40 329 'admin' => CAP_ALLOW
330 )
331 ),
eef868d1 332
bbbf2d40 333 'moodle/role:manage' => array(
eef868d1 334
bcdb0f19 335 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
336
bbbf2d40 337 'captype' => 'write',
338 'contextlevel' => CONTEXT_SYSTEM,
339 'legacy' => array(
bbbf2d40 340 'admin' => CAP_ALLOW
341 )
342 ),
f43ce1ad 343
344 'moodle/role:unassignself' => array(
bcdb0f19 345
f43ce1ad 346 'captype' => 'write',
347 'contextlevel' => CONTEXT_SYSTEM,
348 'legacy' => array(
2d5a4f25 349 'student' => (empty($CFG->allowunenrol)) ? CAP_INHERIT : CAP_ALLOW,
f43ce1ad 350 'teacher' => CAP_ALLOW,
351 'editingteacher' => CAP_ALLOW,
352 'coursecreator' => CAP_ALLOW,
353 'admin' => CAP_ALLOW
354 )
355 ),
99f9cb51 356
357 'moodle/role:viewhiddenassigns' => array(
bcdb0f19 358
99f9cb51 359 'captype' => 'read',
360 'contextlevel' => CONTEXT_SYSTEM,
361 'legacy' => array(
99f9cb51 362 'teacher' => CAP_ALLOW,
363 'editingteacher' => CAP_ALLOW,
99f9cb51 364 'admin' => CAP_ALLOW
365 )
366 ),
eef868d1 367
20dd4cf5 368 'moodle/role:switchroles' => array(
bcdb0f19 369
20dd4cf5 370 'riskbitmask' => RISK_XSS,
bcdb0f19 371
20dd4cf5 372 'captype' => 'read',
373 'contextlevel' => CONTEXT_SYSTEM,
374 'legacy' => array(
20dd4cf5 375 'editingteacher' => CAP_ALLOW,
20dd4cf5 376 'admin' => CAP_ALLOW
377 )
378 ),
379
bbbf2d40 380 'moodle/category:create' => array(
eef868d1 381
89a792ab 382 'riskbitmask' => RISK_XSS,
383
bbbf2d40 384 'captype' => 'write',
385 'contextlevel' => CONTEXT_COURSECAT,
386 'legacy' => array(
bbbf2d40 387 'admin' => CAP_ALLOW
388 )
389 ),
eef868d1 390
bbbf2d40 391 'moodle/category:delete' => array(
eef868d1 392
bbbf2d40 393 'captype' => 'write',
394 'contextlevel' => CONTEXT_COURSECAT,
395 'legacy' => array(
bbbf2d40 396 'admin' => CAP_ALLOW
397 )
398 ),
eef868d1 399
bbbf2d40 400 'moodle/category:update' => array(
eef868d1 401
89a792ab 402 'riskbitmask' => RISK_XSS,
403
bbbf2d40 404 'captype' => 'write',
405 'contextlevel' => CONTEXT_COURSECAT,
406 'legacy' => array(
bbbf2d40 407 'admin' => CAP_ALLOW
408 )
409 ),
eef868d1 410
bbbf2d40 411 'moodle/category:visibility' => array(
eef868d1 412
bbbf2d40 413 'captype' => 'write',
414 'contextlevel' => CONTEXT_COURSECAT,
415 'legacy' => array(
bbbf2d40 416 'admin' => CAP_ALLOW
417 )
418 ),
eef868d1 419
bbbf2d40 420 'moodle/course:create' => array(
eef868d1 421
21b6db6e 422 'riskbitmask' => RISK_XSS,
423
bbbf2d40 424 'captype' => 'write',
5e992f56 425 'contextlevel' => CONTEXT_COURSECAT,
bbbf2d40 426 'legacy' => array(
4473252d 427 'coursecreator' => CAP_ALLOW,
bbbf2d40 428 'admin' => CAP_ALLOW
429 )
430 ),
eef868d1 431
bbbf2d40 432 'moodle/course:delete' => array(
eef868d1 433
bbbf2d40 434 'captype' => 'write',
435 'contextlevel' => CONTEXT_COURSE,
436 'legacy' => array(
bbbf2d40 437 'admin' => CAP_ALLOW
438 )
439 ),
eef868d1 440
bbbf2d40 441 'moodle/course:update' => array(
eef868d1 442
21b6db6e 443 'riskbitmask' => RISK_XSS,
444
bbbf2d40 445 'captype' => 'write',
446 'contextlevel' => CONTEXT_COURSE,
447 'legacy' => array(
bbbf2d40 448 'editingteacher' => CAP_ALLOW,
bbbf2d40 449 'admin' => CAP_ALLOW
450 )
451 ),
eef868d1 452
bbbf2d40 453 'moodle/course:view' => array(
eef868d1 454
bbbf2d40 455 'captype' => 'read',
456 'contextlevel' => CONTEXT_COURSE,
457 'legacy' => array(
b0f55230 458 'guest' => CAP_ALLOW,
bbbf2d40 459 'student' => CAP_ALLOW,
460 'teacher' => CAP_ALLOW,
72cf2e39 461 'editingteacher' => CAP_ALLOW
bbbf2d40 462 )
463 ),
eef868d1 464
77c645df 465 'moodle/course:bulkmessaging' => array(
466
467 'riskbitmask' => RISK_SPAM,
468
469 'captype' => 'write',
470 'contextlevel' => CONTEXT_COURSE,
471 'legacy' => array(
77c645df 472 'teacher' => CAP_ALLOW,
473 'editingteacher' => CAP_ALLOW,
77c645df 474 'admin' => CAP_ALLOW
475 )
476 ),
477
1c45e42e 478 'moodle/course:viewhiddenuserfields' => array(
eef868d1 479
21b6db6e 480 'riskbitmask' => RISK_PERSONAL,
481
1c45e42e 482 'captype' => 'read',
483 'contextlevel' => CONTEXT_COURSE,
484 'legacy' => array(
1c45e42e 485 'teacher' => CAP_ALLOW,
486 'editingteacher' => CAP_ALLOW,
1c45e42e 487 'admin' => CAP_ALLOW
488 )
489 ),
eef868d1 490
1c45e42e 491 'moodle/course:viewhiddencourses' => array(
eef868d1 492
1c45e42e 493 'captype' => 'read',
494 'contextlevel' => CONTEXT_COURSE,
495 'legacy' => array(
2f5ab42b 496 'coursecreator' => CAP_ALLOW,
497 'teacher' => CAP_ALLOW,
498 'editingteacher' => CAP_ALLOW,
499 'admin' => CAP_ALLOW
1c45e42e 500 )
501 ),
eef868d1 502
bbbf2d40 503 'moodle/course:visibility' => array(
eef868d1 504
bbbf2d40 505 'captype' => 'write',
506 'contextlevel' => CONTEXT_COURSE,
507 'legacy' => array(
bbbf2d40 508 'admin' => CAP_ALLOW
509 )
510 ),
eef868d1 511
a028c291 512 'moodle/course:managefiles' => array(
eef868d1 513
21b6db6e 514 'riskbitmask' => RISK_XSS,
515
a028c291 516 'captype' => 'write',
517 'contextlevel' => CONTEXT_COURSE,
518 'legacy' => array(
a028c291 519 'editingteacher' => CAP_ALLOW,
a028c291 520 'admin' => CAP_ALLOW
521 )
522 ),
eef868d1 523
bbbf2d40 524 'moodle/course:manageactivities' => array(
eef868d1 525
21b6db6e 526 'riskbitmask' => RISK_XSS,
527
bbbf2d40 528 'captype' => 'write',
529 'contextlevel' => CONTEXT_COURSE,
530 'legacy' => array(
bbbf2d40 531 'editingteacher' => CAP_ALLOW,
bbbf2d40 532 'admin' => CAP_ALLOW
533 )
534 ),
eef868d1 535
b79da3ac 536 'moodle/course:managemetacourse' => array(
eef868d1 537
4b7aaf40 538 'captype' => 'write',
539 'contextlevel' => CONTEXT_COURSE,
540 'legacy' => array(
4b7aaf40 541 'editingteacher' => CAP_ALLOW,
4b7aaf40 542 'admin' => CAP_ALLOW
543 )
544 ),
eef868d1 545
bbbf2d40 546 'moodle/course:activityvisibility' => array(
eef868d1 547
bbbf2d40 548 'captype' => 'write',
549 'contextlevel' => CONTEXT_COURSE,
550 'legacy' => array(
bbbf2d40 551 'editingteacher' => CAP_ALLOW,
bbbf2d40 552 'admin' => CAP_ALLOW
553 )
554 ),
eef868d1 555
bbbf2d40 556 'moodle/course:viewhiddenactivities' => array(
eef868d1 557
bbbf2d40 558 'captype' => 'write',
559 'contextlevel' => CONTEXT_COURSE,
560 'legacy' => array(
bbbf2d40 561 'teacher' => CAP_ALLOW,
562 'editingteacher' => CAP_ALLOW,
bbbf2d40 563 'admin' => CAP_ALLOW
564 )
565 ),
eef868d1 566
bbbf2d40 567 'moodle/course:viewparticipants' => array(
eef868d1 568
bbbf2d40 569 'captype' => 'read',
570 'contextlevel' => CONTEXT_COURSE,
571 'legacy' => array(
bbbf2d40 572 'student' => CAP_ALLOW,
573 'teacher' => CAP_ALLOW,
574 'editingteacher' => CAP_ALLOW,
bbbf2d40 575 'admin' => CAP_ALLOW
576 )
577 ),
eef868d1 578
bbbf2d40 579 'moodle/course:viewscales' => array(
eef868d1 580
bbbf2d40 581 'captype' => 'read',
582 'contextlevel' => CONTEXT_COURSE,
583 'legacy' => array(
bbbf2d40 584 'student' => CAP_ALLOW,
585 'teacher' => CAP_ALLOW,
586 'editingteacher' => CAP_ALLOW,
bbbf2d40 587 'admin' => CAP_ALLOW
588 )
589 ),
eef868d1 590
bbbf2d40 591 'moodle/course:managescales' => array(
eef868d1 592
bbbf2d40 593 'captype' => 'write',
594 'contextlevel' => CONTEXT_COURSE,
595 'legacy' => array(
bbbf2d40 596 'editingteacher' => CAP_ALLOW,
bbbf2d40 597 'admin' => CAP_ALLOW
598 )
599 ),
eef868d1 600
bbbf2d40 601 'moodle/course:managegroups' => array(
602
603 'captype' => 'write',
604 'contextlevel' => CONTEXT_COURSE,
a028c291 605 'legacy' => array(
a028c291 606 'editingteacher' => CAP_ALLOW,
a028c291 607 'admin' => CAP_ALLOW
608 )
609 ),
eef868d1 610
a028c291 611 'moodle/course:reset' => array(
612
613 'captype' => 'write',
614 'contextlevel' => CONTEXT_COURSE,
bbbf2d40 615 'legacy' => array(
bbbf2d40 616 'editingteacher' => CAP_ALLOW,
bbbf2d40 617 'admin' => CAP_ALLOW
618 )
619 ),
eef868d1 620
bbbf2d40 621 'moodle/blog:view' => array(
622
623 'captype' => 'read',
624 'contextlevel' => CONTEXT_SYSTEM,
625 'legacy' => array(
00adf177 626 'guest' => CAP_ALLOW,
c785d40a 627 'user' => CAP_ALLOW,
bbbf2d40 628 'student' => CAP_ALLOW,
629 'teacher' => CAP_ALLOW,
630 'editingteacher' => CAP_ALLOW,
bbbf2d40 631 'admin' => CAP_ALLOW
632 )
633 ),
eef868d1 634
5a8ab2e9 635 'moodle/blog:create' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 636
21b6db6e 637 'riskbitmask' => RISK_SPAM,
638
bbbf2d40 639 'captype' => 'write',
640 'contextlevel' => CONTEXT_SYSTEM,
641 'legacy' => array(
c785d40a 642 'user' => CAP_ALLOW,
bbbf2d40 643 'admin' => CAP_ALLOW
644 )
645 ),
eef868d1 646
bbbf2d40 647 'moodle/blog:manageofficialtags' => array(
648
21b6db6e 649 'riskbitmask' => RISK_SPAM,
650
bbbf2d40 651 'captype' => 'write',
652 'contextlevel' => CONTEXT_SYSTEM,
653 'legacy' => array(
bbbf2d40 654 'admin' => CAP_ALLOW
655 )
656 ),
eef868d1 657
bbbf2d40 658 'moodle/blog:managepersonaltags' => array(
659
21b6db6e 660 'riskbitmask' => RISK_SPAM,
661
bbbf2d40 662 'captype' => 'write',
663 'contextlevel' => CONTEXT_SYSTEM,
664 'legacy' => array(
bbbf2d40 665 'student' => CAP_ALLOW,
666 'teacher' => CAP_ALLOW,
667 'editingteacher' => CAP_ALLOW,
bbbf2d40 668 'admin' => CAP_ALLOW
669 )
670 ),
eef868d1 671
bbbf2d40 672 'moodle/blog:manageentries' => array(
673
21b6db6e 674 'riskbitmask' => RISK_SPAM,
675
bbbf2d40 676 'captype' => 'write',
677 'contextlevel' => CONTEXT_SYSTEM,
678 'legacy' => array(
bbbf2d40 679 'teacher' => CAP_ALLOW,
680 'editingteacher' => CAP_ALLOW,
bbbf2d40 681 'admin' => CAP_ALLOW
682 )
683 ),
eef868d1 684
5a8ab2e9 685 'moodle/calendar:manageownentries' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 686
21b6db6e 687 'riskbitmask' => RISK_SPAM,
688
bbbf2d40 689 'captype' => 'write',
690 'contextlevel' => CONTEXT_SYSTEM,
691 'legacy' => array(
c785d40a 692 'user' => CAP_ALLOW,
bbbf2d40 693 'admin' => CAP_ALLOW
694 )
695 ),
eef868d1 696
bbbf2d40 697 'moodle/calendar:manageentries' => array(
698
21b6db6e 699 'riskbitmask' => RISK_SPAM,
700
bbbf2d40 701 'captype' => 'write',
702 'contextlevel' => CONTEXT_SYSTEM,
703 'legacy' => array(
bbbf2d40 704 'teacher' => CAP_ALLOW,
705 'editingteacher' => CAP_ALLOW,
bbbf2d40 706 'admin' => CAP_ALLOW
707 )
77d4953e 708 ),
a044c05d 709
710 'moodle/user:editprofile' => array(
711
712 'riskbitmask' => RISK_SPAM,
713
714 'captype' => 'write',
715 'contextlevel' => CONTEXT_USER,
716 'legacy' => array(
717 'admin' => CAP_ALLOW
718 )
719 ),
eef868d1 720
1cb3da36 721 'moodle/user:editownprofile' => array(
722
723 'captype' => 'write',
724 'contextlevel' => CONTEXT_SYSTEM,
725 'legacy' => array(
726 'guest' => CAP_PROHIBIT,
727 'user' => CAP_ALLOW,
728 'admin' => CAP_ALLOW
729 )
730 ),
731
732 'moodle/user:changeownpassword' => array(
733
734 'captype' => 'write',
735 'contextlevel' => CONTEXT_SYSTEM,
736 'legacy' => array(
737 'guest' => CAP_PROHIBIT,
738 'user' => CAP_ALLOW,
739 'admin' => CAP_ALLOW
740 )
741 ),
742
eef868d1 743 // The next 3 might make no sense for some roles, e.g teacher, etc.
77d4953e 744 // since the next level up is site. These are more for the parent role
745 'moodle/user:readuserposts' => array(
bcdb0f19 746
77d4953e 747 'captype' => 'read',
4b10f08b 748 'contextlevel' => CONTEXT_USER,
77d4953e 749 'legacy' => array(
77d4953e 750 'student' => CAP_ALLOW,
751 'teacher' => CAP_ALLOW,
752 'editingteacher' => CAP_ALLOW,
77d4953e 753 'admin' => CAP_ALLOW
754 )
755 ),
eef868d1 756
77d4953e 757 'moodle/user:readuserblogs' => array(
bcdb0f19 758
77d4953e 759 'captype' => 'read',
4b10f08b 760 'contextlevel' => CONTEXT_USER,
77d4953e 761 'legacy' => array(
77d4953e 762 'student' => CAP_ALLOW,
763 'teacher' => CAP_ALLOW,
764 'editingteacher' => CAP_ALLOW,
77d4953e 765 'admin' => CAP_ALLOW
766 )
767 ),
eef868d1 768
77d4953e 769 'moodle/user:viewuseractivitiesreport' => array(
bcdb0f19 770
77d4953e 771 'captype' => 'read',
4b10f08b 772 'contextlevel' => CONTEXT_USER,
77d4953e 773 'legacy' => array(
77d4953e 774 'teacher' => CAP_ALLOW,
775 'editingteacher' => CAP_ALLOW,
77d4953e 776 'admin' => CAP_ALLOW
777 )
945f88ca 778 ),
eef868d1 779
945f88ca 780 'moodle/question:import' => array(
21b6db6e 781
782 'riskbitmask' => RISK_XSS,
783
945f88ca 784 'captype' => 'write',
785 'contextlevel' => CONTEXT_COURSE,
786 'legacy' => array(
945f88ca 787 'editingteacher' => CAP_ALLOW,
945f88ca 788 'admin' => CAP_ALLOW
789 )
790 ),
eef868d1 791
945f88ca 792 'moodle/question:export' => array(
bcdb0f19 793
945f88ca 794 'captype' => 'read',
795 'contextlevel' => CONTEXT_COURSE,
796 'legacy' => array(
945f88ca 797 'editingteacher' => CAP_ALLOW,
945f88ca 798 'admin' => CAP_ALLOW
799 )
800 ),
eef868d1 801
f43ce1ad 802 'moodle/question:managecategory' => array(
bcdb0f19 803
945f88ca 804 'captype' => 'write',
805 'contextlevel' => CONTEXT_COURSE,
806 'legacy' => array(
945f88ca 807 'editingteacher' => CAP_ALLOW,
945f88ca 808 'admin' => CAP_ALLOW
809 )
810 ),
eef868d1 811
945f88ca 812 'moodle/question:manage' => array(
21b6db6e 813
814 'riskbitmask' => RISK_XSS,
815
945f88ca 816 'captype' => 'write',
817 'contextlevel' => CONTEXT_COURSE,
818 'legacy' => array(
945f88ca 819 'editingteacher' => CAP_ALLOW,
945f88ca 820 'admin' => CAP_ALLOW
821 )
7191a1fa 822 ),
823
0eb6b04a 824 // Configure the installed question types.
825 'moodle/question:config' => array(
826
827 'riskbitmask' => RISK_CONFIG,
828
829 'captype' => 'write',
830 'contextlevel' => CONTEXT_SYSTEM,
831 'legacy' => array(
832 'admin' => CAP_ALLOW
833 )
834 ),
835
7191a1fa 836 'moodle/site:doclinks' => array(
bcdb0f19 837
7191a1fa 838 'captype' => 'read',
839 'contextlevel' => CONTEXT_SYSTEM,
840 'legacy' => array(
7191a1fa 841 'teacher' => CAP_ALLOW,
842 'editingteacher' => CAP_ALLOW,
7191a1fa 843 'admin' => CAP_ALLOW
844 )
3924b988 845 ),
eef868d1 846
3924b988 847 'moodle/course:sectionvisibility' => array(
bcdb0f19 848
3924b988 849 'captype' => 'write',
850 'contextlevel' => CONTEXT_COURSE,
851 'legacy' => array(
3924b988 852 'editingteacher' => CAP_ALLOW,
3924b988 853 'admin' => CAP_ALLOW
854 )
855 ),
eef868d1 856
dc558690 857 'moodle/course:useremail' => array(
bcdb0f19 858
dc558690 859 'captype' => 'write',
860 'contextlevel' => CONTEXT_COURSE,
861 'legacy' => array(
dc558690 862 'editingteacher' => CAP_ALLOW,
dc558690 863 'admin' => CAP_ALLOW
864 )
865 ),
eef868d1 866
3924b988 867 'moodle/course:viewhiddensections' => array(
bcdb0f19 868
3924b988 869 'captype' => 'write',
870 'contextlevel' => CONTEXT_COURSE,
871 'legacy' => array(
3924b988 872 'editingteacher' => CAP_ALLOW,
3924b988 873 'admin' => CAP_ALLOW
874 )
875 ),
eef868d1 876
3924b988 877 'moodle/course:setcurrentsection' => array(
bcdb0f19 878
3924b988 879 'captype' => 'write',
880 'contextlevel' => CONTEXT_COURSE,
881 'legacy' => array(
3924b988 882 'editingteacher' => CAP_ALLOW,
3924b988 883 'admin' => CAP_ALLOW
884 )
885 ),
eef868d1 886
dd45888a 887 'moodle/site:mnetlogintoremote' => array(
888 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
3924b988 889 'captype' => 'read',
dd45888a 890 'contextlevel' => CONTEXT_SYSTEM,
3924b988 891 'legacy' => array(
3924b988 892 'admin' => CAP_ALLOW
893 )
894 ),
eef868d1 895
dd45888a 896 'moodle/grade:viewall' => array(
bcdb0f19 897 'riskbitmask' => RISK_PERSONAL,
dd45888a 898 'captype' => 'read',
3924b988 899 'contextlevel' => CONTEXT_COURSE,
900 'legacy' => array(
dd45888a 901 'teacher' => CAP_ALLOW,
3924b988 902 'editingteacher' => CAP_ALLOW,
3924b988 903 'admin' => CAP_ALLOW
dd45888a 904 ),
905 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
f509ce06 906 ),
f43ce1ad 907
dd45888a 908 'moodle/grade:view' => array(
f509ce06 909 'captype' => 'read',
dd45888a 910 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_PERSONAL too
f509ce06 911 'legacy' => array(
dd45888a 912 'student' => CAP_ALLOW
f509ce06 913 )
ca9ffa18 914 ),
dd45888a 915
916 'moodle/grade:viewhidden' => array(
ca9ffa18 917 'riskbitmask' => RISK_PERSONAL,
918 'captype' => 'read',
dd45888a 919 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_PERSONAL too
ca9ffa18 920 'legacy' => array(
dd45888a 921 ),
922 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
ca9ffa18 923 ),
dd45888a 924
925 'moodle/grade:import' => array(
ca9ffa18 926 'riskbitmask' => RISK_PERSONAL,
dd45888a 927 'captype' => 'write',
ca9ffa18 928 'contextlevel' => CONTEXT_COURSE,
929 'legacy' => array(
ca9ffa18 930 'editingteacher' => CAP_ALLOW,
931 'admin' => CAP_ALLOW
dd45888a 932 ),
933 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 934 ),
dd45888a 935
936 'moodle/grade:export' => array(
ca9ffa18 937 'riskbitmask' => RISK_PERSONAL,
938 'captype' => 'read',
939 'contextlevel' => CONTEXT_COURSE,
940 'legacy' => array(
941 'teacher' => CAP_ALLOW,
942 'editingteacher' => CAP_ALLOW,
943 'admin' => CAP_ALLOW
dd45888a 944 ),
945 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 946 ),
dd45888a 947
948 'moodle/grade:manage' => array(
ca9ffa18 949 'riskbitmask' => RISK_PERSONAL,
dd45888a 950 'captype' => 'write',
951 'contextlevel' => CONTEXT_COURSE,
ca9ffa18 952 'legacy' => array(
dd45888a 953 'editingteacher' => CAP_ALLOW,
ca9ffa18 954 'admin' => CAP_ALLOW
dd45888a 955 ),
956 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 957 ),
dd45888a 958
ca9ffa18 959 'moodle/grade:hide' => array(
960 'captype' => 'write',
961 'contextlevel' => CONTEXT_COURSE,
962 'legacy' => array(
963 'editingteacher' => CAP_ALLOW,
964 'admin' => CAP_ALLOW
965 )
966 ),
dd45888a 967
ca9ffa18 968 'moodle/grade:lock' => array(
969 'captype' => 'write',
970 'contextlevel' => CONTEXT_COURSE,
971 'legacy' => array(
972 'editingteacher' => CAP_ALLOW,
973 'admin' => CAP_ALLOW
974 )
975 ),
dd45888a 976
977 'moodle/grade:unlock' => array(
978 'captype' => 'write',
ca9ffa18 979 'contextlevel' => CONTEXT_COURSE,
980 'legacy' => array(
981 'editingteacher' => CAP_ALLOW,
982 'admin' => CAP_ALLOW
983 )
984 ),
dd45888a 985
986 'moodle/grade:override' => array(
ca9ffa18 987 'captype' => 'write',
988 'contextlevel' => CONTEXT_COURSE,
989 'legacy' => array(
990 'editingteacher' => CAP_ALLOW,
991 'admin' => CAP_ALLOW
992 )
282c1695 993 ),
dd45888a 994
995 'moodle/my:manageblocks' => array(
282c1695 996 'captype' => 'write',
997 'contextlevel' => CONTEXT_SYSTEM,
998 'legacy' => array(
999 'user' => CAP_ALLOW
1000 )
eca3af25 1001 ),
dd45888a 1002
eca3af25 1003 'moodle/notes:view' => array(
1004 'captype' => 'read',
1005 'contextlevel' => CONTEXT_SYSTEM,
1006 'legacy' => array(
1007 'teacher' => CAP_ALLOW,
1008 'editingteacher' => CAP_ALLOW,
1009 'admin' => CAP_ALLOW
1010 )
1011 ),
1012
1013 'moodle/notes:manage' => array(
1014 'captype' => 'write',
1015 'contextlevel' => CONTEXT_SYSTEM,
1016 'legacy' => array(
1017 'teacher' => CAP_ALLOW,
1018 'editingteacher' => CAP_ALLOW,
1019 'admin' => CAP_ALLOW
1020 )
dd45888a 1021 ),
bbbf2d40 1022);
1023
1024?>