MDL-13925
[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 ),
576ad290 123
124 'moodle/site:sendmessage' => array(
125
126 'riskbitmask' => RISK_PERSONAL,
127
128 'captype' => 'write',
129 'contextlevel' => CONTEXT_SYSTEM,
130 'legacy' => array(
131 'admin' => CAP_ALLOW,
132 'user' => CAP_ALLOW
133 )
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',
152 'contextlevel' => CONTEXT_SYSTEM,
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',
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:restore' => array(
eef868d1 172
21b6db6e 173 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
174
bbbf2d40 175 'captype' => 'write',
176 'contextlevel' => CONTEXT_SYSTEM,
177 'legacy' => array(
7246585a 178 'editingteacher' => CAP_ALLOW,
bbbf2d40 179 'admin' => CAP_ALLOW
180 )
181 ),
eef868d1 182
bbbf2d40 183 'moodle/site:manageblocks' => array(
eef868d1 184
21b6db6e 185 'riskbitmask' => RISK_SPAM | RISK_XSS,
186
bbbf2d40 187 'captype' => 'write',
188 'contextlevel' => CONTEXT_SYSTEM,
189 'legacy' => array(
73b73d21 190 'editingteacher' => CAP_ALLOW,
bbbf2d40 191 'admin' => CAP_ALLOW
192 )
193 ),
eef868d1 194
27950688 195 'moodle/site:accessallgroups' => array(
eef868d1 196
27950688 197 'captype' => 'read',
198 'contextlevel' => CONTEXT_SYSTEM,
199 'legacy' => array(
27950688 200 'teacher' => CAP_ALLOW,
201 'editingteacher' => CAP_ALLOW,
27950688 202 'admin' => CAP_ALLOW
203 )
204 ),
eef868d1 205
53d7785b 206 'moodle/site:viewfullnames' => array(
eef868d1 207
53d7785b 208 'captype' => 'read',
209 'contextlevel' => CONTEXT_SYSTEM,
210 'legacy' => array(
53d7785b 211 'teacher' => CAP_ALLOW,
212 'editingteacher' => CAP_ALLOW,
53d7785b 213 'admin' => CAP_ALLOW
214 )
215 ),
eef868d1 216
a028c291 217 'moodle/site:viewreports' => array(
eef868d1 218
21b6db6e 219 'riskbitmask' => RISK_PERSONAL,
220
a028c291 221 'captype' => 'read',
77d4953e 222 'contextlevel' => CONTEXT_SYSTEM,
a028c291 223 'legacy' => array(
a028c291 224 'teacher' => CAP_ALLOW,
225 'editingteacher' => CAP_ALLOW,
a028c291 226 'admin' => CAP_ALLOW
227 )
228 ),
eef868d1 229
7d8a3cb0 230 'moodle/site:trustcontent' => array(
eef868d1 231
21b6db6e 232 'riskbitmask' => RISK_XSS,
233
7d8a3cb0 234 'captype' => 'write',
235 'contextlevel' => CONTEXT_SYSTEM,
236 'legacy' => array(
7d8a3cb0 237 'editingteacher' => CAP_ALLOW,
7d8a3cb0 238 'admin' => CAP_ALLOW
239 )
240 ),
eef868d1 241
6df3c7df 242 'moodle/site:uploadusers' => array(
eef868d1 243
21b6db6e 244 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
245
bbbf2d40 246 'captype' => 'write',
247 'contextlevel' => CONTEXT_SYSTEM,
248 'legacy' => array(
bbbf2d40 249 'admin' => CAP_ALLOW
250 )
251 ),
eef868d1 252
2a55410b 253 'moodle/site:langeditmaster' => array(
254
255 'riskbitmask' => RISK_CONFIG | RISK_XSS,
256
257 'captype' => 'write',
258 'contextlevel' => CONTEXT_SYSTEM,
259 'legacy' => array(
260 'admin' => CAP_PREVENT
261 )
262 ),
263
264 'moodle/site:langeditlocal' => array(
265
266 'riskbitmask' => RISK_CONFIG | RISK_XSS,
267
268 'captype' => 'write',
269 'contextlevel' => CONTEXT_SYSTEM,
270 'legacy' => array(
271 'admin' => CAP_ALLOW
272 )
273 ),
274
6df3c7df 275
276 'moodle/user:create' => array(
277
278 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
eef868d1 279
bbbf2d40 280 'captype' => 'write',
281 'contextlevel' => CONTEXT_SYSTEM,
282 'legacy' => array(
bbbf2d40 283 'admin' => CAP_ALLOW
284 )
285 ),
eef868d1 286
6df3c7df 287 'moodle/user:delete' => array(
cc891abe 288
bcdb0f19 289 'riskbitmask' => RISK_PERSONAL,
290
cc891abe 291 'captype' => 'write',
292 'contextlevel' => CONTEXT_SYSTEM,
293 'legacy' => array(
cc891abe 294 'admin' => CAP_ALLOW
295 )
296 ),
297
6df3c7df 298 'moodle/user:update' => array(
cc891abe 299
300 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
21b6db6e 301
bbbf2d40 302 'captype' => 'write',
303 'contextlevel' => CONTEXT_SYSTEM,
304 'legacy' => array(
bbbf2d40 305 'admin' => CAP_ALLOW
306 )
307 ),
eef868d1 308
bbbf2d40 309 'moodle/user:viewdetails' => array(
eef868d1 310
e58eca72 311 'captype' => 'read',
bbbf2d40 312 'contextlevel' => CONTEXT_SYSTEM,
313 'legacy' => array(
22ae509e 314 'guest' => CAP_ALLOW,
315 'student' => CAP_ALLOW,
316 'teacher' => CAP_ALLOW,
317 'editingteacher' => CAP_ALLOW,
bbbf2d40 318 'admin' => CAP_ALLOW
319 )
320 ),
e58eca72 321
322 'moodle/user:viewhiddendetails' => array(
eef868d1 323
21b6db6e 324 'riskbitmask' => RISK_PERSONAL,
325
e58eca72 326 'captype' => 'read',
327 'contextlevel' => CONTEXT_SYSTEM,
328 'legacy' => array(
e58eca72 329 'teacher' => CAP_ALLOW,
330 'editingteacher' => CAP_ALLOW,
e58eca72 331 'admin' => CAP_ALLOW
332 )
333 ),
eef868d1 334
6c95827f 335 'moodle/user:loginas' => array(
336
337 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
338
339 'captype' => 'write',
340 'contextlevel' => CONTEXT_COURSE,
341 'legacy' => array(
6c95827f 342 'admin' => CAP_ALLOW
343 )
344 ),
345
bbbf2d40 346 'moodle/role:assign' => array(
eef868d1 347
bbbf2d40 348 'captype' => 'write',
349 'contextlevel' => CONTEXT_SYSTEM,
350 'legacy' => array(
861fdcaa 351 'editingteacher' => CAP_ALLOW,
68c52526 352 'admin' => CAP_ALLOW
353 )
354 ),
eef868d1 355
68c52526 356 'moodle/role:override' => array(
eef868d1 357
bcdb0f19 358 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
359
68c52526 360 'captype' => 'write',
361 'contextlevel' => CONTEXT_SYSTEM,
362 'legacy' => array(
bbbf2d40 363 'admin' => CAP_ALLOW
364 )
365 ),
eef868d1 366
bbbf2d40 367 'moodle/role:manage' => array(
eef868d1 368
bcdb0f19 369 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
370
bbbf2d40 371 'captype' => 'write',
372 'contextlevel' => CONTEXT_SYSTEM,
373 'legacy' => array(
bbbf2d40 374 'admin' => CAP_ALLOW
375 )
376 ),
f43ce1ad 377
378 'moodle/role:unassignself' => array(
bcdb0f19 379
f43ce1ad 380 'captype' => 'write',
381 'contextlevel' => CONTEXT_SYSTEM,
382 'legacy' => array(
2d5a4f25 383 'student' => (empty($CFG->allowunenrol)) ? CAP_INHERIT : CAP_ALLOW,
f43ce1ad 384 'teacher' => CAP_ALLOW,
385 'editingteacher' => CAP_ALLOW,
386 'coursecreator' => CAP_ALLOW,
387 'admin' => CAP_ALLOW
388 )
389 ),
99f9cb51 390
391 'moodle/role:viewhiddenassigns' => array(
bcdb0f19 392
99f9cb51 393 'captype' => 'read',
394 'contextlevel' => CONTEXT_SYSTEM,
395 'legacy' => array(
99f9cb51 396 'teacher' => CAP_ALLOW,
397 'editingteacher' => CAP_ALLOW,
99f9cb51 398 'admin' => CAP_ALLOW
399 )
400 ),
eef868d1 401
20dd4cf5 402 'moodle/role:switchroles' => array(
bcdb0f19 403
20dd4cf5 404 'riskbitmask' => RISK_XSS,
bcdb0f19 405
20dd4cf5 406 'captype' => 'read',
407 'contextlevel' => CONTEXT_SYSTEM,
408 'legacy' => array(
20dd4cf5 409 'editingteacher' => CAP_ALLOW,
20dd4cf5 410 'admin' => CAP_ALLOW
411 )
412 ),
413
bbbf2d40 414 'moodle/category:create' => array(
eef868d1 415
89a792ab 416 'riskbitmask' => RISK_XSS,
417
bbbf2d40 418 'captype' => 'write',
419 'contextlevel' => CONTEXT_COURSECAT,
420 'legacy' => array(
bbbf2d40 421 'admin' => CAP_ALLOW
422 )
423 ),
eef868d1 424
bbbf2d40 425 'moodle/category:delete' => array(
eef868d1 426
bbbf2d40 427 'captype' => 'write',
428 'contextlevel' => CONTEXT_COURSECAT,
429 'legacy' => array(
bbbf2d40 430 'admin' => CAP_ALLOW
431 )
432 ),
eef868d1 433
bbbf2d40 434 'moodle/category:update' => array(
eef868d1 435
89a792ab 436 'riskbitmask' => RISK_XSS,
437
bbbf2d40 438 'captype' => 'write',
439 'contextlevel' => CONTEXT_COURSECAT,
440 'legacy' => array(
bbbf2d40 441 'admin' => CAP_ALLOW
442 )
443 ),
eef868d1 444
bbbf2d40 445 'moodle/category:visibility' => array(
eef868d1 446
bbbf2d40 447 'captype' => 'write',
448 'contextlevel' => CONTEXT_COURSECAT,
449 'legacy' => array(
bbbf2d40 450 'admin' => CAP_ALLOW
451 )
452 ),
eef868d1 453
bbbf2d40 454 'moodle/course:create' => array(
eef868d1 455
21b6db6e 456 'riskbitmask' => RISK_XSS,
457
bbbf2d40 458 'captype' => 'write',
5e992f56 459 'contextlevel' => CONTEXT_COURSECAT,
bbbf2d40 460 'legacy' => array(
4473252d 461 'coursecreator' => CAP_ALLOW,
bbbf2d40 462 'admin' => CAP_ALLOW
463 )
464 ),
eef868d1 465
bbbf2d40 466 'moodle/course:delete' => array(
eef868d1 467
bbbf2d40 468 'captype' => 'write',
469 'contextlevel' => CONTEXT_COURSE,
470 'legacy' => array(
bbbf2d40 471 'admin' => CAP_ALLOW
472 )
473 ),
eef868d1 474
bbbf2d40 475 'moodle/course:update' => array(
eef868d1 476
21b6db6e 477 'riskbitmask' => RISK_XSS,
478
bbbf2d40 479 'captype' => 'write',
480 'contextlevel' => CONTEXT_COURSE,
481 'legacy' => array(
bbbf2d40 482 'editingteacher' => CAP_ALLOW,
bbbf2d40 483 'admin' => CAP_ALLOW
484 )
485 ),
eef868d1 486
bbbf2d40 487 'moodle/course:view' => array(
eef868d1 488
bbbf2d40 489 'captype' => 'read',
490 'contextlevel' => CONTEXT_COURSE,
491 'legacy' => array(
b0f55230 492 'guest' => CAP_ALLOW,
bbbf2d40 493 'student' => CAP_ALLOW,
494 'teacher' => CAP_ALLOW,
72cf2e39 495 'editingteacher' => CAP_ALLOW
bbbf2d40 496 )
497 ),
eef868d1 498
77c645df 499 'moodle/course:bulkmessaging' => array(
500
501 'riskbitmask' => RISK_SPAM,
502
503 'captype' => 'write',
504 'contextlevel' => CONTEXT_COURSE,
505 'legacy' => array(
77c645df 506 'teacher' => CAP_ALLOW,
507 'editingteacher' => CAP_ALLOW,
77c645df 508 'admin' => CAP_ALLOW
509 )
510 ),
511
1c45e42e 512 'moodle/course:viewhiddenuserfields' => array(
eef868d1 513
21b6db6e 514 'riskbitmask' => RISK_PERSONAL,
515
1c45e42e 516 'captype' => 'read',
517 'contextlevel' => CONTEXT_COURSE,
518 'legacy' => array(
1c45e42e 519 'teacher' => CAP_ALLOW,
520 'editingteacher' => CAP_ALLOW,
1c45e42e 521 'admin' => CAP_ALLOW
522 )
523 ),
eef868d1 524
1c45e42e 525 'moodle/course:viewhiddencourses' => array(
eef868d1 526
1c45e42e 527 'captype' => 'read',
528 'contextlevel' => CONTEXT_COURSE,
529 'legacy' => array(
2f5ab42b 530 'coursecreator' => CAP_ALLOW,
531 'teacher' => CAP_ALLOW,
532 'editingteacher' => CAP_ALLOW,
a5b8be62 533 'admin' => CAP_ALLOW
1c45e42e 534 )
535 ),
eef868d1 536
bbbf2d40 537 'moodle/course:visibility' => array(
eef868d1 538
bbbf2d40 539 'captype' => 'write',
540 'contextlevel' => CONTEXT_COURSE,
541 'legacy' => array(
bbbf2d40 542 'admin' => CAP_ALLOW
543 )
544 ),
eef868d1 545
a028c291 546 'moodle/course:managefiles' => array(
eef868d1 547
21b6db6e 548 'riskbitmask' => RISK_XSS,
549
a028c291 550 'captype' => 'write',
551 'contextlevel' => CONTEXT_COURSE,
552 'legacy' => array(
a028c291 553 'editingteacher' => CAP_ALLOW,
a028c291 554 'admin' => CAP_ALLOW
555 )
556 ),
eef868d1 557
bbbf2d40 558 'moodle/course:manageactivities' => array(
eef868d1 559
21b6db6e 560 'riskbitmask' => RISK_XSS,
561
bbbf2d40 562 'captype' => 'write',
563 'contextlevel' => CONTEXT_COURSE,
564 'legacy' => array(
bbbf2d40 565 'editingteacher' => CAP_ALLOW,
bbbf2d40 566 'admin' => CAP_ALLOW
567 )
568 ),
eef868d1 569
b79da3ac 570 'moodle/course:managemetacourse' => array(
eef868d1 571
4b7aaf40 572 'captype' => 'write',
573 'contextlevel' => CONTEXT_COURSE,
574 'legacy' => array(
4b7aaf40 575 'editingteacher' => CAP_ALLOW,
4b7aaf40 576 'admin' => CAP_ALLOW
577 )
578 ),
eef868d1 579
bbbf2d40 580 'moodle/course:activityvisibility' => array(
eef868d1 581
bbbf2d40 582 'captype' => 'write',
583 'contextlevel' => CONTEXT_COURSE,
584 'legacy' => array(
bbbf2d40 585 'editingteacher' => CAP_ALLOW,
bbbf2d40 586 'admin' => CAP_ALLOW
587 )
588 ),
eef868d1 589
bbbf2d40 590 'moodle/course:viewhiddenactivities' => array(
eef868d1 591
bbbf2d40 592 'captype' => 'write',
593 'contextlevel' => CONTEXT_COURSE,
594 'legacy' => array(
bbbf2d40 595 'teacher' => CAP_ALLOW,
596 'editingteacher' => CAP_ALLOW,
bbbf2d40 597 'admin' => CAP_ALLOW
598 )
599 ),
eef868d1 600
bbbf2d40 601 'moodle/course:viewparticipants' => array(
eef868d1 602
bbbf2d40 603 'captype' => 'read',
604 'contextlevel' => CONTEXT_COURSE,
605 'legacy' => array(
bbbf2d40 606 'student' => CAP_ALLOW,
607 'teacher' => CAP_ALLOW,
608 'editingteacher' => CAP_ALLOW,
bbbf2d40 609 'admin' => CAP_ALLOW
165088f6 610 )
611 ),
612
613 'moodle/site:viewparticipants' => array(
614
615 'captype' => 'read',
616 'contextlevel' => CONTEXT_SYSTEM,
617 'legacy' => array(
618 'admin' => CAP_ALLOW
bbbf2d40 619 )
620 ),
eef868d1 621
bbbf2d40 622 'moodle/course:viewscales' => array(
eef868d1 623
bbbf2d40 624 'captype' => 'read',
625 'contextlevel' => CONTEXT_COURSE,
626 'legacy' => array(
bbbf2d40 627 'student' => CAP_ALLOW,
628 'teacher' => CAP_ALLOW,
629 'editingteacher' => CAP_ALLOW,
bbbf2d40 630 'admin' => CAP_ALLOW
631 )
632 ),
eef868d1 633
bbbf2d40 634 'moodle/course:managescales' => array(
eef868d1 635
bbbf2d40 636 'captype' => 'write',
637 'contextlevel' => CONTEXT_COURSE,
638 'legacy' => array(
bbbf2d40 639 'editingteacher' => CAP_ALLOW,
bbbf2d40 640 'admin' => CAP_ALLOW
641 )
642 ),
eef868d1 643
bbbf2d40 644 'moodle/course:managegroups' => array(
645
646 'captype' => 'write',
647 'contextlevel' => CONTEXT_COURSE,
a028c291 648 'legacy' => array(
a028c291 649 'editingteacher' => CAP_ALLOW,
a028c291 650 'admin' => CAP_ALLOW
651 )
652 ),
eef868d1 653
a028c291 654 'moodle/course:reset' => array(
655
656 'captype' => 'write',
657 'contextlevel' => CONTEXT_COURSE,
bbbf2d40 658 'legacy' => array(
bbbf2d40 659 'editingteacher' => CAP_ALLOW,
bbbf2d40 660 'admin' => CAP_ALLOW
661 )
662 ),
eef868d1 663
bbbf2d40 664 'moodle/blog:view' => array(
665
666 'captype' => 'read',
667 'contextlevel' => CONTEXT_SYSTEM,
668 'legacy' => array(
00adf177 669 'guest' => CAP_ALLOW,
c785d40a 670 'user' => CAP_ALLOW,
bbbf2d40 671 'student' => CAP_ALLOW,
672 'teacher' => CAP_ALLOW,
673 'editingteacher' => CAP_ALLOW,
bbbf2d40 674 'admin' => CAP_ALLOW
675 )
676 ),
eef868d1 677
5a8ab2e9 678 'moodle/blog:create' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 679
21b6db6e 680 'riskbitmask' => RISK_SPAM,
681
bbbf2d40 682 'captype' => 'write',
683 'contextlevel' => CONTEXT_SYSTEM,
684 'legacy' => array(
c785d40a 685 'user' => CAP_ALLOW,
bbbf2d40 686 'admin' => CAP_ALLOW
687 )
688 ),
eef868d1 689
bbbf2d40 690 'moodle/blog:manageentries' => array(
691
21b6db6e 692 'riskbitmask' => RISK_SPAM,
693
bbbf2d40 694 'captype' => 'write',
695 'contextlevel' => CONTEXT_SYSTEM,
696 'legacy' => array(
bbbf2d40 697 'teacher' => CAP_ALLOW,
698 'editingteacher' => CAP_ALLOW,
bbbf2d40 699 'admin' => CAP_ALLOW
700 )
701 ),
eef868d1 702
5a8ab2e9 703 'moodle/calendar:manageownentries' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 704
21b6db6e 705 'riskbitmask' => RISK_SPAM,
706
bbbf2d40 707 'captype' => 'write',
708 'contextlevel' => CONTEXT_SYSTEM,
709 'legacy' => array(
c785d40a 710 'user' => CAP_ALLOW,
bbbf2d40 711 'admin' => CAP_ALLOW
712 )
713 ),
eef868d1 714
f63d2922 715 'moodle/calendar:managegroupentries' => array(
716
717 'riskbitmask' => RISK_SPAM,
718
719 'captype' => 'write',
720 'contextlevel' => CONTEXT_SYSTEM,
721 'legacy' => array(
722 'teacher' => CAP_ALLOW,
723 'editingteacher' => CAP_ALLOW,
724 'admin' => CAP_ALLOW
725 )
726 ),
727
bbbf2d40 728 'moodle/calendar:manageentries' => array(
729
21b6db6e 730 'riskbitmask' => RISK_SPAM,
731
bbbf2d40 732 'captype' => 'write',
733 'contextlevel' => CONTEXT_SYSTEM,
734 'legacy' => array(
bbbf2d40 735 'teacher' => CAP_ALLOW,
736 'editingteacher' => CAP_ALLOW,
bbbf2d40 737 'admin' => CAP_ALLOW
738 )
77d4953e 739 ),
a044c05d 740
741 'moodle/user:editprofile' => array(
742
743 'riskbitmask' => RISK_SPAM,
744
745 'captype' => 'write',
746 'contextlevel' => CONTEXT_USER,
747 'legacy' => array(
748 'admin' => CAP_ALLOW
749 )
750 ),
eef868d1 751
a5b8be62 752 'moodle/user:editownprofile' => array(
1cb3da36 753
a5b8be62 754 'captype' => 'write',
755 'contextlevel' => CONTEXT_SYSTEM,
756 'legacy' => array(
1cb3da36 757 'guest' => CAP_PROHIBIT,
758 'user' => CAP_ALLOW,
759 'admin' => CAP_ALLOW
a5b8be62 760 )
1cb3da36 761 ),
762
a5b8be62 763 'moodle/user:changeownpassword' => array(
1cb3da36 764
a5b8be62 765 'captype' => 'write',
766 'contextlevel' => CONTEXT_SYSTEM,
767 'legacy' => array(
1cb3da36 768 'guest' => CAP_PROHIBIT,
769 'user' => CAP_ALLOW,
770 'admin' => CAP_ALLOW
a5b8be62 771 )
1cb3da36 772 ),
773
eef868d1 774 // The next 3 might make no sense for some roles, e.g teacher, etc.
77d4953e 775 // since the next level up is site. These are more for the parent role
776 'moodle/user:readuserposts' => array(
bcdb0f19 777
77d4953e 778 'captype' => 'read',
4b10f08b 779 'contextlevel' => CONTEXT_USER,
77d4953e 780 'legacy' => array(
77d4953e 781 'student' => CAP_ALLOW,
782 'teacher' => CAP_ALLOW,
783 'editingteacher' => CAP_ALLOW,
77d4953e 784 'admin' => CAP_ALLOW
785 )
786 ),
eef868d1 787
77d4953e 788 'moodle/user:readuserblogs' => array(
bcdb0f19 789
77d4953e 790 'captype' => 'read',
4b10f08b 791 'contextlevel' => CONTEXT_USER,
77d4953e 792 'legacy' => array(
77d4953e 793 'student' => CAP_ALLOW,
794 'teacher' => CAP_ALLOW,
795 'editingteacher' => CAP_ALLOW,
77d4953e 796 'admin' => CAP_ALLOW
797 )
798 ),
eef868d1 799
77d4953e 800 'moodle/user:viewuseractivitiesreport' => array(
bcdb0f19 801
77d4953e 802 'captype' => 'read',
4b10f08b 803 'contextlevel' => CONTEXT_USER,
77d4953e 804 'legacy' => array(
77d4953e 805 'teacher' => CAP_ALLOW,
806 'editingteacher' => CAP_ALLOW,
77d4953e 807 'admin' => CAP_ALLOW
808 )
945f88ca 809 ),
eef868d1 810
271e6dec 811 'moodle/question:managecategory' => array(
21b6db6e 812
945f88ca 813 'captype' => 'write',
814 'contextlevel' => CONTEXT_COURSE,
815 'legacy' => array(
945f88ca 816 'editingteacher' => CAP_ALLOW,
945f88ca 817 'admin' => CAP_ALLOW
818 )
a5b8be62 819 ),
820
271e6dec 821 //new in moodle 1.9
822 'moodle/question:add' => array(
823 'riskbitmask' => RISK_SPAM,
824 'captype' => 'write',
825 'contextlevel' => CONTEXT_COURSE,
826 'legacy' => array(
827 'editingteacher' => CAP_ALLOW,
828 'admin' => CAP_ALLOW
829 ),
830 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 831 ),
271e6dec 832 'moodle/question:editmine' => array(
833 'riskbitmask' => RISK_SPAM,
834 'captype' => 'write',
835 'contextlevel' => CONTEXT_COURSE,
836 'legacy' => array(
837 'editingteacher' => CAP_ALLOW,
838 'admin' => CAP_ALLOW
839 ),
a5b8be62 840 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 841 ),
842 'moodle/question:editall' => array(
843 'riskbitmask' => RISK_SPAM,
844 'captype' => 'write',
845 'contextlevel' => CONTEXT_COURSE,
846 'legacy' => array(
847 'editingteacher' => CAP_ALLOW,
848 'admin' => CAP_ALLOW
849 ),
a5b8be62 850 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 851 ),
852 'moodle/question:viewmine' => array(
945f88ca 853 'captype' => 'read',
854 'contextlevel' => CONTEXT_COURSE,
855 'legacy' => array(
945f88ca 856 'editingteacher' => CAP_ALLOW,
945f88ca 857 'admin' => CAP_ALLOW
271e6dec 858 ),
a5b8be62 859 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 860 ),
271e6dec 861 'moodle/question:viewall' => array(
862 'captype' => 'read',
863 'contextlevel' => CONTEXT_COURSE,
864 'legacy' => array(
865 'editingteacher' => CAP_ALLOW,
866 'admin' => CAP_ALLOW
867 ),
a5b8be62 868 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 869 ),
870 'moodle/question:usemine' => array(
871 'captype' => 'read',
872 'contextlevel' => CONTEXT_COURSE,
873 'legacy' => array(
874 'editingteacher' => CAP_ALLOW,
875 'admin' => CAP_ALLOW
876 ),
a5b8be62 877 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 878 ),
879 'moodle/question:useall' => array(
880 'captype' => 'read',
881 'contextlevel' => CONTEXT_COURSE,
882 'legacy' => array(
883 'editingteacher' => CAP_ALLOW,
884 'admin' => CAP_ALLOW
885 ),
a5b8be62 886 'clonepermissionsfrom' => 'moodle/question:manage'
887 ),
271e6dec 888 'moodle/question:movemine' => array(
945f88ca 889 'captype' => 'write',
890 'contextlevel' => CONTEXT_COURSE,
891 'legacy' => array(
945f88ca 892 'editingteacher' => CAP_ALLOW,
945f88ca 893 'admin' => CAP_ALLOW
271e6dec 894 ),
a5b8be62 895 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 896 ),
271e6dec 897 'moodle/question:moveall' => array(
945f88ca 898 'captype' => 'write',
899 'contextlevel' => CONTEXT_COURSE,
900 'legacy' => array(
945f88ca 901 'editingteacher' => CAP_ALLOW,
945f88ca 902 'admin' => CAP_ALLOW
271e6dec 903 ),
a5b8be62 904 'clonepermissionsfrom' => 'moodle/question:manage'
7191a1fa 905 ),
271e6dec 906 //END new in moodle 1.9
a5b8be62 907
0eb6b04a 908 // Configure the installed question types.
909 'moodle/question:config' => array(
910
911 'riskbitmask' => RISK_CONFIG,
912
913 'captype' => 'write',
914 'contextlevel' => CONTEXT_SYSTEM,
915 'legacy' => array(
916 'admin' => CAP_ALLOW
917 )
918 ),
919
7191a1fa 920 'moodle/site:doclinks' => array(
bcdb0f19 921
7191a1fa 922 'captype' => 'read',
923 'contextlevel' => CONTEXT_SYSTEM,
924 'legacy' => array(
7191a1fa 925 'teacher' => CAP_ALLOW,
926 'editingteacher' => CAP_ALLOW,
7191a1fa 927 'admin' => CAP_ALLOW
928 )
3924b988 929 ),
eef868d1 930
3924b988 931 'moodle/course:sectionvisibility' => array(
bcdb0f19 932
3924b988 933 'captype' => 'write',
934 'contextlevel' => CONTEXT_COURSE,
935 'legacy' => array(
3924b988 936 'editingteacher' => CAP_ALLOW,
3924b988 937 'admin' => CAP_ALLOW
938 )
939 ),
eef868d1 940
dc558690 941 'moodle/course:useremail' => array(
bcdb0f19 942
dc558690 943 'captype' => 'write',
944 'contextlevel' => CONTEXT_COURSE,
945 'legacy' => array(
dc558690 946 'editingteacher' => CAP_ALLOW,
dc558690 947 'admin' => CAP_ALLOW
948 )
949 ),
eef868d1 950
3924b988 951 'moodle/course:viewhiddensections' => array(
bcdb0f19 952
3924b988 953 'captype' => 'write',
954 'contextlevel' => CONTEXT_COURSE,
955 'legacy' => array(
3924b988 956 'editingteacher' => CAP_ALLOW,
3924b988 957 'admin' => CAP_ALLOW
958 )
959 ),
eef868d1 960
3924b988 961 'moodle/course:setcurrentsection' => array(
bcdb0f19 962
3924b988 963 'captype' => 'write',
964 'contextlevel' => CONTEXT_COURSE,
965 'legacy' => array(
3924b988 966 'editingteacher' => CAP_ALLOW,
3924b988 967 'admin' => CAP_ALLOW
968 )
969 ),
eef868d1 970
dd45888a 971 'moodle/site:mnetlogintoremote' => array(
972 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
3924b988 973 'captype' => 'read',
dd45888a 974 'contextlevel' => CONTEXT_SYSTEM,
3924b988 975 'legacy' => array(
3924b988 976 'admin' => CAP_ALLOW
977 )
978 ),
eef868d1 979
dd45888a 980 'moodle/grade:viewall' => array(
bcdb0f19 981 'riskbitmask' => RISK_PERSONAL,
dd45888a 982 'captype' => 'read',
eecf76df 983 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_USER
3924b988 984 'legacy' => array(
dd45888a 985 'teacher' => CAP_ALLOW,
3924b988 986 'editingteacher' => CAP_ALLOW,
3924b988 987 'admin' => CAP_ALLOW
dd45888a 988 ),
989 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
f509ce06 990 ),
f43ce1ad 991
dd45888a 992 'moodle/grade:view' => array(
f509ce06 993 'captype' => 'read',
eecf76df 994 'contextlevel' => CONTEXT_COURSE,
f509ce06 995 'legacy' => array(
dd45888a 996 'student' => CAP_ALLOW
f509ce06 997 )
ca9ffa18 998 ),
dd45888a 999
1000 'moodle/grade:viewhidden' => array(
ca9ffa18 1001 'riskbitmask' => RISK_PERSONAL,
1002 'captype' => 'read',
eecf76df 1003 'contextlevel' => CONTEXT_COURSE,
ca9ffa18 1004 'legacy' => array(
0371f8e5 1005 'teacher' => CAP_ALLOW,
1006 'editingteacher' => CAP_ALLOW,
1007 'admin' => CAP_ALLOW
dd45888a 1008 ),
1009 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
ca9ffa18 1010 ),
dd45888a 1011
1012 'moodle/grade:import' => array(
ca9ffa18 1013 'riskbitmask' => RISK_PERSONAL,
dd45888a 1014 'captype' => 'write',
ca9ffa18 1015 'contextlevel' => CONTEXT_COURSE,
1016 'legacy' => array(
ca9ffa18 1017 'editingteacher' => CAP_ALLOW,
1018 'admin' => CAP_ALLOW
dd45888a 1019 ),
1020 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1021 ),
dd45888a 1022
1023 'moodle/grade:export' => array(
ca9ffa18 1024 'riskbitmask' => RISK_PERSONAL,
1025 'captype' => 'read',
1026 'contextlevel' => CONTEXT_COURSE,
1027 'legacy' => array(
1028 'teacher' => CAP_ALLOW,
1029 'editingteacher' => CAP_ALLOW,
1030 'admin' => CAP_ALLOW
dd45888a 1031 ),
1032 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1033 ),
dd45888a 1034
1035 'moodle/grade:manage' => array(
ca9ffa18 1036 'riskbitmask' => RISK_PERSONAL,
dd45888a 1037 'captype' => 'write',
1038 'contextlevel' => CONTEXT_COURSE,
ca9ffa18 1039 'legacy' => array(
dd45888a 1040 'editingteacher' => CAP_ALLOW,
ca9ffa18 1041 'admin' => CAP_ALLOW
dd45888a 1042 ),
1043 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1044 ),
dd45888a 1045
a5b8be62 1046 'moodle/grade:edit' => array(
1047 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
04259694 1048 'captype' => 'write',
1049 'contextlevel' => CONTEXT_COURSE,
1050 'legacy' => array(
1051 'editingteacher' => CAP_ALLOW,
1052 'admin' => CAP_ALLOW
1053 ),
1054 'clonepermissionsfrom' => 'moodle/course:managegrades'
1055 ),
1056
a5b8be62 1057 'moodle/grade:manageoutcomes' => array(
284abb09 1058 'captype' => 'write',
1059 'contextlevel' => CONTEXT_COURSE,
1060 'legacy' => array(
1061 'editingteacher' => CAP_ALLOW,
1062 'admin' => CAP_ALLOW
1063 ),
1064 'clonepermissionsfrom' => 'moodle/course:managegrades'
1065 ),
1066
1067 'moodle/grade:manageletters' => array(
ca9ffa18 1068 'captype' => 'write',
1069 'contextlevel' => CONTEXT_COURSE,
1070 'legacy' => array(
1071 'editingteacher' => CAP_ALLOW,
1072 'admin' => CAP_ALLOW
a5b8be62 1073 ),
1074 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1075 ),
dd45888a 1076
a5b8be62 1077 'moodle/grade:hide' => array(
ca9ffa18 1078 'captype' => 'write',
1079 'contextlevel' => CONTEXT_COURSE,
1080 'legacy' => array(
1081 'editingteacher' => CAP_ALLOW,
1082 'admin' => CAP_ALLOW
1083 )
1084 ),
dd45888a 1085
a5b8be62 1086 'moodle/grade:lock' => array(
dd45888a 1087 'captype' => 'write',
ca9ffa18 1088 'contextlevel' => CONTEXT_COURSE,
1089 'legacy' => array(
1090 'editingteacher' => CAP_ALLOW,
1091 'admin' => CAP_ALLOW
1092 )
1093 ),
dd45888a 1094
a5b8be62 1095 'moodle/grade:unlock' => array(
ca9ffa18 1096 'captype' => 'write',
1097 'contextlevel' => CONTEXT_COURSE,
1098 'legacy' => array(
1099 'editingteacher' => CAP_ALLOW,
1100 'admin' => CAP_ALLOW
1101 )
282c1695 1102 ),
dd45888a 1103
1104 'moodle/my:manageblocks' => array(
282c1695 1105 'captype' => 'write',
1106 'contextlevel' => CONTEXT_SYSTEM,
1107 'legacy' => array(
1108 'user' => CAP_ALLOW
1109 )
eca3af25 1110 ),
dd45888a 1111
eca3af25 1112 'moodle/notes:view' => array(
1113 'captype' => 'read',
1114 'contextlevel' => CONTEXT_SYSTEM,
1115 'legacy' => array(
1116 'teacher' => CAP_ALLOW,
1117 'editingteacher' => CAP_ALLOW,
1118 'admin' => CAP_ALLOW
1119 )
1120 ),
1121
1122 'moodle/notes:manage' => array(
1123 'captype' => 'write',
1124 'contextlevel' => CONTEXT_SYSTEM,
1125 'legacy' => array(
1126 'teacher' => CAP_ALLOW,
1127 'editingteacher' => CAP_ALLOW,
1128 'admin' => CAP_ALLOW
1129 )
dd45888a 1130 ),
79642064 1131
1132 'moodle/tag:manage' => array(
1133 'captype' => 'write',
1134 'contextlevel' => CONTEXT_SYSTEM,
1135 'legacy' => array(
1136 'teacher' => CAP_ALLOW,
1137 'editingteacher' => CAP_ALLOW,
1138 'admin' => CAP_ALLOW
1139 )
705789bd 1140 ),
1141
1142 'moodle/tag:create' => array(
1143 'captype' => 'write',
1144 'contextlevel' => CONTEXT_SYSTEM,
1145 'legacy' => array(
0f07c40e 1146 'admin' => CAP_ALLOW,
1147 'user' => CAP_ALLOW
705789bd 1148 )
1149 ),
a5b8be62 1150
705789bd 1151 'moodle/tag:edit' => array(
1152 'captype' => 'write',
1153 'contextlevel' => CONTEXT_SYSTEM,
1154 'legacy' => array(
3e6e529f 1155 'admin' => CAP_ALLOW,
1156 'user' => CAP_ALLOW
98b5789d 1157 )
1158 ),
a5b8be62 1159
98b5789d 1160 'moodle/tag:editblocks' => array(
1161 'captype' => 'write',
1162 'contextlevel' => CONTEXT_SYSTEM,
1163 'legacy' => array(
705789bd 1164 'teacher' => CAP_ALLOW,
1165 'editingteacher' => CAP_ALLOW,
1166 'admin' => CAP_ALLOW
1167 )
7e874772 1168 ),
1169
1170 'moodle/block:view' => array(
1171 'captype' => 'read',
1172 'contextlevel' => CONTEXT_BLOCK,
1173 'legacy' => array(
1174 'guest' => CAP_ALLOW,
25a7d980 1175 'user' => CAP_ALLOW,
1176 'student' => CAP_ALLOW,
1177 'teacher' => CAP_ALLOW,
1178 'editingteacher' => CAP_ALLOW,
1179 'coursecreator' => CAP_ALLOW
7e874772 1180 )
79642064 1181 )
bbbf2d40 1182);
1183
98b5789d 1184
bbbf2d40 1185?>