MDL-14731 we can not rely on internal connection by default
[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
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 )
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
3a0c6cca 289 'riskbitmask' => RISK_PERSONAL, RISK_DATALOSS,
bcdb0f19 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
3a0c6cca 348 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
349
bbbf2d40 350 'captype' => 'write',
351 'contextlevel' => CONTEXT_SYSTEM,
352 'legacy' => array(
861fdcaa 353 'editingteacher' => CAP_ALLOW,
68c52526 354 'admin' => CAP_ALLOW
355 )
356 ),
eef868d1 357
68c52526 358 'moodle/role:override' => array(
eef868d1 359
bcdb0f19 360 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
361
68c52526 362 'captype' => 'write',
363 'contextlevel' => CONTEXT_SYSTEM,
364 'legacy' => array(
bbbf2d40 365 'admin' => CAP_ALLOW
366 )
367 ),
eef868d1 368
3a0c6cca 369 'moodle/role:safeoverride' => array(
370
371 'riskbitmask' => RISK_SPAM,
372
373 'captype' => 'write',
374 'contextlevel' => CONTEXT_SYSTEM,
375 'legacy' => array(
376 'editingteacher' => CAP_ALLOW
377 )
378 ),
379
bbbf2d40 380 'moodle/role:manage' => array(
eef868d1 381
bcdb0f19 382 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
383
bbbf2d40 384 'captype' => 'write',
385 'contextlevel' => CONTEXT_SYSTEM,
386 'legacy' => array(
bbbf2d40 387 'admin' => CAP_ALLOW
388 )
389 ),
f43ce1ad 390
391 'moodle/role:unassignself' => array(
bcdb0f19 392
f43ce1ad 393 'captype' => 'write',
394 'contextlevel' => CONTEXT_SYSTEM,
395 'legacy' => array(
2d5a4f25 396 'student' => (empty($CFG->allowunenrol)) ? CAP_INHERIT : CAP_ALLOW,
f43ce1ad 397 'teacher' => CAP_ALLOW,
398 'editingteacher' => CAP_ALLOW,
399 'coursecreator' => CAP_ALLOW,
400 'admin' => CAP_ALLOW
401 )
402 ),
99f9cb51 403
404 'moodle/role:viewhiddenassigns' => array(
bcdb0f19 405
99f9cb51 406 'captype' => 'read',
407 'contextlevel' => CONTEXT_SYSTEM,
408 'legacy' => array(
99f9cb51 409 'teacher' => CAP_ALLOW,
410 'editingteacher' => CAP_ALLOW,
99f9cb51 411 'admin' => CAP_ALLOW
412 )
413 ),
eef868d1 414
20dd4cf5 415 'moodle/role:switchroles' => array(
bcdb0f19 416
3a0c6cca 417 'riskbitmask' => RISK_XSS | RISK_PERSONAL,
bcdb0f19 418
20dd4cf5 419 'captype' => 'read',
420 'contextlevel' => CONTEXT_SYSTEM,
421 'legacy' => array(
20dd4cf5 422 'editingteacher' => CAP_ALLOW,
20dd4cf5 423 'admin' => CAP_ALLOW
424 )
425 ),
426
bbbf2d40 427 'moodle/category:create' => array(
eef868d1 428
89a792ab 429 'riskbitmask' => RISK_XSS,
430
bbbf2d40 431 'captype' => 'write',
432 'contextlevel' => CONTEXT_COURSECAT,
433 'legacy' => array(
bbbf2d40 434 'admin' => CAP_ALLOW
435 )
436 ),
eef868d1 437
bbbf2d40 438 'moodle/category:delete' => array(
eef868d1 439
3a0c6cca 440 'riskbitmask' => RISK_DATALOSS,
441
bbbf2d40 442 'captype' => 'write',
443 'contextlevel' => CONTEXT_COURSECAT,
444 'legacy' => array(
bbbf2d40 445 'admin' => CAP_ALLOW
446 )
447 ),
eef868d1 448
bbbf2d40 449 'moodle/category:update' => array(
eef868d1 450
89a792ab 451 'riskbitmask' => RISK_XSS,
452
bbbf2d40 453 'captype' => 'write',
454 'contextlevel' => CONTEXT_COURSECAT,
455 'legacy' => array(
bbbf2d40 456 'admin' => CAP_ALLOW
457 )
458 ),
eef868d1 459
bbbf2d40 460 'moodle/category:visibility' => array(
eef868d1 461
bbbf2d40 462 'captype' => 'write',
463 'contextlevel' => CONTEXT_COURSECAT,
464 'legacy' => array(
bbbf2d40 465 'admin' => CAP_ALLOW
466 )
467 ),
eef868d1 468
bbbf2d40 469 'moodle/course:create' => array(
eef868d1 470
21b6db6e 471 'riskbitmask' => RISK_XSS,
472
bbbf2d40 473 'captype' => 'write',
5e992f56 474 'contextlevel' => CONTEXT_COURSECAT,
bbbf2d40 475 'legacy' => array(
4473252d 476 'coursecreator' => CAP_ALLOW,
bbbf2d40 477 'admin' => CAP_ALLOW
478 )
479 ),
eef868d1 480
bbbf2d40 481 'moodle/course:delete' => array(
eef868d1 482
3a0c6cca 483 'riskbitmask' => RISK_DATALOSS,
484
bbbf2d40 485 'captype' => 'write',
486 'contextlevel' => CONTEXT_COURSE,
487 'legacy' => array(
bbbf2d40 488 'admin' => CAP_ALLOW
489 )
490 ),
eef868d1 491
bbbf2d40 492 'moodle/course:update' => array(
eef868d1 493
21b6db6e 494 'riskbitmask' => RISK_XSS,
495
bbbf2d40 496 'captype' => 'write',
497 'contextlevel' => CONTEXT_COURSE,
498 'legacy' => array(
bbbf2d40 499 'editingteacher' => CAP_ALLOW,
bbbf2d40 500 'admin' => CAP_ALLOW
501 )
502 ),
eef868d1 503
bbbf2d40 504 'moodle/course:view' => array(
eef868d1 505
bbbf2d40 506 'captype' => 'read',
507 'contextlevel' => CONTEXT_COURSE,
508 'legacy' => array(
b0f55230 509 'guest' => CAP_ALLOW,
bbbf2d40 510 'student' => CAP_ALLOW,
511 'teacher' => CAP_ALLOW,
72cf2e39 512 'editingteacher' => CAP_ALLOW
bbbf2d40 513 )
514 ),
eef868d1 515
77c645df 516 'moodle/course:bulkmessaging' => array(
517
518 'riskbitmask' => RISK_SPAM,
519
520 'captype' => 'write',
521 'contextlevel' => CONTEXT_COURSE,
522 'legacy' => array(
77c645df 523 'teacher' => CAP_ALLOW,
524 'editingteacher' => CAP_ALLOW,
77c645df 525 'admin' => CAP_ALLOW
526 )
527 ),
528
1c45e42e 529 'moodle/course:viewhiddenuserfields' => array(
eef868d1 530
21b6db6e 531 'riskbitmask' => RISK_PERSONAL,
532
1c45e42e 533 'captype' => 'read',
534 'contextlevel' => CONTEXT_COURSE,
535 'legacy' => array(
1c45e42e 536 'teacher' => CAP_ALLOW,
537 'editingteacher' => CAP_ALLOW,
1c45e42e 538 'admin' => CAP_ALLOW
539 )
540 ),
eef868d1 541
1c45e42e 542 'moodle/course:viewhiddencourses' => array(
eef868d1 543
1c45e42e 544 'captype' => 'read',
545 'contextlevel' => CONTEXT_COURSE,
546 'legacy' => array(
2f5ab42b 547 'coursecreator' => CAP_ALLOW,
548 'teacher' => CAP_ALLOW,
549 'editingteacher' => CAP_ALLOW,
a5b8be62 550 'admin' => CAP_ALLOW
1c45e42e 551 )
552 ),
eef868d1 553
bbbf2d40 554 'moodle/course:visibility' => array(
eef868d1 555
bbbf2d40 556 'captype' => 'write',
557 'contextlevel' => CONTEXT_COURSE,
558 'legacy' => array(
bbbf2d40 559 'admin' => CAP_ALLOW
560 )
561 ),
eef868d1 562
a028c291 563 'moodle/course:managefiles' => array(
eef868d1 564
21b6db6e 565 'riskbitmask' => RISK_XSS,
566
a028c291 567 'captype' => 'write',
568 'contextlevel' => CONTEXT_COURSE,
569 'legacy' => array(
a028c291 570 'editingteacher' => CAP_ALLOW,
a028c291 571 'admin' => CAP_ALLOW
572 )
573 ),
eef868d1 574
bbbf2d40 575 'moodle/course:manageactivities' => array(
eef868d1 576
21b6db6e 577 'riskbitmask' => RISK_XSS,
578
bbbf2d40 579 'captype' => 'write',
580 'contextlevel' => CONTEXT_COURSE,
581 'legacy' => array(
bbbf2d40 582 'editingteacher' => CAP_ALLOW,
bbbf2d40 583 'admin' => CAP_ALLOW
584 )
585 ),
eef868d1 586
b79da3ac 587 'moodle/course:managemetacourse' => array(
eef868d1 588
3a0c6cca 589 'riskbitmask' => RISK_XSS | RISK_PERSONAL,
590
4b7aaf40 591 'captype' => 'write',
592 'contextlevel' => CONTEXT_COURSE,
593 'legacy' => array(
4b7aaf40 594 'editingteacher' => CAP_ALLOW,
4b7aaf40 595 'admin' => CAP_ALLOW
596 )
597 ),
eef868d1 598
bbbf2d40 599 'moodle/course:activityvisibility' => array(
eef868d1 600
bbbf2d40 601 'captype' => 'write',
602 'contextlevel' => CONTEXT_COURSE,
603 'legacy' => array(
bbbf2d40 604 'editingteacher' => CAP_ALLOW,
bbbf2d40 605 'admin' => CAP_ALLOW
606 )
607 ),
eef868d1 608
bbbf2d40 609 'moodle/course:viewhiddenactivities' => array(
eef868d1 610
bbbf2d40 611 'captype' => 'write',
612 'contextlevel' => CONTEXT_COURSE,
613 'legacy' => array(
bbbf2d40 614 'teacher' => CAP_ALLOW,
615 'editingteacher' => CAP_ALLOW,
bbbf2d40 616 'admin' => CAP_ALLOW
617 )
618 ),
eef868d1 619
bbbf2d40 620 'moodle/course:viewparticipants' => array(
eef868d1 621
bbbf2d40 622 'captype' => 'read',
623 'contextlevel' => CONTEXT_COURSE,
624 'legacy' => array(
bbbf2d40 625 'student' => CAP_ALLOW,
626 'teacher' => CAP_ALLOW,
627 'editingteacher' => CAP_ALLOW,
bbbf2d40 628 'admin' => CAP_ALLOW
165088f6 629 )
630 ),
631
632 'moodle/site:viewparticipants' => array(
633
634 'captype' => 'read',
635 'contextlevel' => CONTEXT_SYSTEM,
636 'legacy' => array(
637 'admin' => CAP_ALLOW
bbbf2d40 638 )
639 ),
eef868d1 640
bbbf2d40 641 'moodle/course:viewscales' => array(
eef868d1 642
bbbf2d40 643 'captype' => 'read',
644 'contextlevel' => CONTEXT_COURSE,
645 'legacy' => array(
bbbf2d40 646 'student' => CAP_ALLOW,
647 'teacher' => CAP_ALLOW,
648 'editingteacher' => CAP_ALLOW,
bbbf2d40 649 'admin' => CAP_ALLOW
650 )
651 ),
eef868d1 652
bbbf2d40 653 'moodle/course:managescales' => array(
eef868d1 654
bbbf2d40 655 'captype' => 'write',
656 'contextlevel' => CONTEXT_COURSE,
657 'legacy' => array(
bbbf2d40 658 'editingteacher' => CAP_ALLOW,
bbbf2d40 659 'admin' => CAP_ALLOW
660 )
661 ),
eef868d1 662
bbbf2d40 663 'moodle/course:managegroups' => array(
664
665 'captype' => 'write',
666 'contextlevel' => CONTEXT_COURSE,
a028c291 667 'legacy' => array(
a028c291 668 'editingteacher' => CAP_ALLOW,
a028c291 669 'admin' => CAP_ALLOW
670 )
671 ),
eef868d1 672
a028c291 673 'moodle/course:reset' => array(
674
3a0c6cca 675 'riskbitmask' => RISK_DATALOSS,
676
a028c291 677 'captype' => 'write',
678 'contextlevel' => CONTEXT_COURSE,
bbbf2d40 679 'legacy' => array(
bbbf2d40 680 'editingteacher' => CAP_ALLOW,
bbbf2d40 681 'admin' => CAP_ALLOW
682 )
683 ),
eef868d1 684
bbbf2d40 685 'moodle/blog:view' => array(
686
687 'captype' => 'read',
688 'contextlevel' => CONTEXT_SYSTEM,
689 'legacy' => array(
00adf177 690 'guest' => CAP_ALLOW,
c785d40a 691 'user' => CAP_ALLOW,
bbbf2d40 692 'student' => CAP_ALLOW,
693 'teacher' => CAP_ALLOW,
694 'editingteacher' => CAP_ALLOW,
bbbf2d40 695 'admin' => CAP_ALLOW
696 )
697 ),
eef868d1 698
5a8ab2e9 699 'moodle/blog:create' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 700
21b6db6e 701 'riskbitmask' => RISK_SPAM,
702
bbbf2d40 703 'captype' => 'write',
704 'contextlevel' => CONTEXT_SYSTEM,
705 'legacy' => array(
c785d40a 706 'user' => CAP_ALLOW,
bbbf2d40 707 'admin' => CAP_ALLOW
708 )
709 ),
eef868d1 710
bbbf2d40 711 'moodle/blog:manageentries' => array(
712
21b6db6e 713 'riskbitmask' => RISK_SPAM,
714
bbbf2d40 715 'captype' => 'write',
716 'contextlevel' => CONTEXT_SYSTEM,
717 'legacy' => array(
bbbf2d40 718 'teacher' => CAP_ALLOW,
719 'editingteacher' => CAP_ALLOW,
bbbf2d40 720 'admin' => CAP_ALLOW
721 )
722 ),
eef868d1 723
5a8ab2e9 724 'moodle/calendar:manageownentries' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 725
21b6db6e 726 'riskbitmask' => RISK_SPAM,
727
bbbf2d40 728 'captype' => 'write',
729 'contextlevel' => CONTEXT_SYSTEM,
730 'legacy' => array(
c785d40a 731 'user' => CAP_ALLOW,
bbbf2d40 732 'admin' => CAP_ALLOW
733 )
734 ),
eef868d1 735
f63d2922 736 'moodle/calendar:managegroupentries' => array(
737
738 'riskbitmask' => RISK_SPAM,
739
740 'captype' => 'write',
741 'contextlevel' => CONTEXT_SYSTEM,
742 'legacy' => array(
743 'teacher' => CAP_ALLOW,
744 'editingteacher' => CAP_ALLOW,
745 'admin' => CAP_ALLOW
746 )
747 ),
748
bbbf2d40 749 'moodle/calendar:manageentries' => array(
750
21b6db6e 751 'riskbitmask' => RISK_SPAM,
752
bbbf2d40 753 'captype' => 'write',
754 'contextlevel' => CONTEXT_SYSTEM,
755 'legacy' => array(
bbbf2d40 756 'teacher' => CAP_ALLOW,
757 'editingteacher' => CAP_ALLOW,
bbbf2d40 758 'admin' => CAP_ALLOW
759 )
77d4953e 760 ),
a044c05d 761
762 'moodle/user:editprofile' => array(
763
3a0c6cca 764 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
a044c05d 765
766 'captype' => 'write',
767 'contextlevel' => CONTEXT_USER,
768 'legacy' => array(
769 'admin' => CAP_ALLOW
770 )
771 ),
eef868d1 772
a5b8be62 773 'moodle/user:editownprofile' => array(
1cb3da36 774
3a0c6cca 775 'riskbitmask' => RISK_SPAM,
776
a5b8be62 777 'captype' => 'write',
778 'contextlevel' => CONTEXT_SYSTEM,
779 'legacy' => array(
1cb3da36 780 'guest' => CAP_PROHIBIT,
781 'user' => CAP_ALLOW,
782 'admin' => CAP_ALLOW
a5b8be62 783 )
1cb3da36 784 ),
785
a5b8be62 786 'moodle/user:changeownpassword' => array(
1cb3da36 787
a5b8be62 788 'captype' => 'write',
789 'contextlevel' => CONTEXT_SYSTEM,
790 'legacy' => array(
1cb3da36 791 'guest' => CAP_PROHIBIT,
792 'user' => CAP_ALLOW,
793 'admin' => CAP_ALLOW
a5b8be62 794 )
1cb3da36 795 ),
796
eef868d1 797 // The next 3 might make no sense for some roles, e.g teacher, etc.
77d4953e 798 // since the next level up is site. These are more for the parent role
799 'moodle/user:readuserposts' => array(
bcdb0f19 800
77d4953e 801 'captype' => 'read',
4b10f08b 802 'contextlevel' => CONTEXT_USER,
77d4953e 803 'legacy' => array(
77d4953e 804 'student' => CAP_ALLOW,
805 'teacher' => CAP_ALLOW,
806 'editingteacher' => CAP_ALLOW,
77d4953e 807 'admin' => CAP_ALLOW
808 )
809 ),
eef868d1 810
77d4953e 811 'moodle/user:readuserblogs' => array(
bcdb0f19 812
77d4953e 813 'captype' => 'read',
4b10f08b 814 'contextlevel' => CONTEXT_USER,
77d4953e 815 'legacy' => array(
77d4953e 816 'student' => CAP_ALLOW,
817 'teacher' => CAP_ALLOW,
818 'editingteacher' => CAP_ALLOW,
77d4953e 819 'admin' => CAP_ALLOW
820 )
821 ),
eef868d1 822
77d4953e 823 'moodle/user:viewuseractivitiesreport' => array(
bcdb0f19 824
77d4953e 825 'captype' => 'read',
4b10f08b 826 'contextlevel' => CONTEXT_USER,
77d4953e 827 'legacy' => array(
77d4953e 828 'teacher' => CAP_ALLOW,
829 'editingteacher' => CAP_ALLOW,
77d4953e 830 'admin' => CAP_ALLOW
831 )
945f88ca 832 ),
3b120e46 833
834 //capabilities designed for the new message system configuration
835 'moodle/user:editmessageprofile' => array(
836
837 'riskbitmask' => RISK_SPAM,
838
839 'captype' => 'write',
840 'contextlevel' => CONTEXT_USER,
841 'legacy' => array(
842 'admin' => CAP_ALLOW
843 )
844 ),
845
846 'moodle/user:editownmessageprofile' => array(
847
848 'captype' => 'write',
849 'contextlevel' => CONTEXT_SYSTEM,
850 'legacy' => array(
851 'guest' => CAP_PROHIBIT,
852 'user' => CAP_ALLOW,
853 'admin' => CAP_ALLOW
854 )
855 ),
eef868d1 856
271e6dec 857 'moodle/question:managecategory' => array(
21b6db6e 858
945f88ca 859 'captype' => 'write',
860 'contextlevel' => CONTEXT_COURSE,
861 'legacy' => array(
945f88ca 862 'editingteacher' => CAP_ALLOW,
945f88ca 863 'admin' => CAP_ALLOW
864 )
a5b8be62 865 ),
866
271e6dec 867 //new in moodle 1.9
868 'moodle/question:add' => array(
869 'riskbitmask' => RISK_SPAM,
870 'captype' => 'write',
871 'contextlevel' => CONTEXT_COURSE,
872 'legacy' => array(
873 'editingteacher' => CAP_ALLOW,
874 'admin' => CAP_ALLOW
875 ),
876 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 877 ),
271e6dec 878 'moodle/question:editmine' => array(
879 'riskbitmask' => RISK_SPAM,
880 'captype' => 'write',
881 'contextlevel' => CONTEXT_COURSE,
882 'legacy' => array(
883 'editingteacher' => CAP_ALLOW,
884 'admin' => CAP_ALLOW
885 ),
a5b8be62 886 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 887 ),
888 'moodle/question:editall' => array(
889 'riskbitmask' => RISK_SPAM,
890 'captype' => 'write',
891 'contextlevel' => CONTEXT_COURSE,
892 'legacy' => array(
893 'editingteacher' => CAP_ALLOW,
894 'admin' => CAP_ALLOW
895 ),
a5b8be62 896 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 897 ),
898 'moodle/question:viewmine' => array(
945f88ca 899 'captype' => 'read',
900 'contextlevel' => CONTEXT_COURSE,
901 'legacy' => array(
945f88ca 902 'editingteacher' => CAP_ALLOW,
945f88ca 903 'admin' => CAP_ALLOW
271e6dec 904 ),
a5b8be62 905 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 906 ),
271e6dec 907 'moodle/question:viewall' => array(
908 'captype' => 'read',
909 'contextlevel' => CONTEXT_COURSE,
910 'legacy' => array(
911 'editingteacher' => CAP_ALLOW,
912 'admin' => CAP_ALLOW
913 ),
a5b8be62 914 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 915 ),
916 'moodle/question:usemine' => array(
917 'captype' => 'read',
918 'contextlevel' => CONTEXT_COURSE,
919 'legacy' => array(
920 'editingteacher' => CAP_ALLOW,
921 'admin' => CAP_ALLOW
922 ),
a5b8be62 923 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 924 ),
925 'moodle/question:useall' => array(
926 'captype' => 'read',
927 'contextlevel' => CONTEXT_COURSE,
928 'legacy' => array(
929 'editingteacher' => CAP_ALLOW,
930 'admin' => CAP_ALLOW
931 ),
a5b8be62 932 'clonepermissionsfrom' => 'moodle/question:manage'
933 ),
271e6dec 934 'moodle/question:movemine' => array(
945f88ca 935 'captype' => 'write',
936 'contextlevel' => CONTEXT_COURSE,
937 'legacy' => array(
945f88ca 938 'editingteacher' => CAP_ALLOW,
945f88ca 939 'admin' => CAP_ALLOW
271e6dec 940 ),
a5b8be62 941 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 942 ),
271e6dec 943 'moodle/question:moveall' => array(
945f88ca 944 'captype' => 'write',
945 'contextlevel' => CONTEXT_COURSE,
946 'legacy' => array(
945f88ca 947 'editingteacher' => CAP_ALLOW,
945f88ca 948 'admin' => CAP_ALLOW
271e6dec 949 ),
a5b8be62 950 'clonepermissionsfrom' => 'moodle/question:manage'
7191a1fa 951 ),
271e6dec 952 //END new in moodle 1.9
a5b8be62 953
0eb6b04a 954 // Configure the installed question types.
955 'moodle/question:config' => array(
956
957 'riskbitmask' => RISK_CONFIG,
958
959 'captype' => 'write',
960 'contextlevel' => CONTEXT_SYSTEM,
961 'legacy' => array(
962 'admin' => CAP_ALLOW
963 )
964 ),
965
7191a1fa 966 'moodle/site:doclinks' => array(
bcdb0f19 967
7191a1fa 968 'captype' => 'read',
969 'contextlevel' => CONTEXT_SYSTEM,
970 'legacy' => array(
7191a1fa 971 'teacher' => CAP_ALLOW,
972 'editingteacher' => CAP_ALLOW,
7191a1fa 973 'admin' => CAP_ALLOW
974 )
3924b988 975 ),
eef868d1 976
3924b988 977 'moodle/course:sectionvisibility' => array(
bcdb0f19 978
3924b988 979 'captype' => 'write',
980 'contextlevel' => CONTEXT_COURSE,
981 'legacy' => array(
3924b988 982 'editingteacher' => CAP_ALLOW,
3924b988 983 'admin' => CAP_ALLOW
984 )
985 ),
eef868d1 986
dc558690 987 'moodle/course:useremail' => array(
bcdb0f19 988
dc558690 989 'captype' => 'write',
990 'contextlevel' => CONTEXT_COURSE,
991 'legacy' => array(
dc558690 992 'editingteacher' => CAP_ALLOW,
dc558690 993 'admin' => CAP_ALLOW
994 )
995 ),
eef868d1 996
3924b988 997 'moodle/course:viewhiddensections' => array(
bcdb0f19 998
3924b988 999 'captype' => 'write',
1000 'contextlevel' => CONTEXT_COURSE,
1001 'legacy' => array(
3924b988 1002 'editingteacher' => CAP_ALLOW,
3924b988 1003 'admin' => CAP_ALLOW
1004 )
1005 ),
eef868d1 1006
3924b988 1007 'moodle/course:setcurrentsection' => array(
bcdb0f19 1008
3924b988 1009 'captype' => 'write',
1010 'contextlevel' => CONTEXT_COURSE,
1011 'legacy' => array(
3924b988 1012 'editingteacher' => CAP_ALLOW,
3924b988 1013 'admin' => CAP_ALLOW
1014 )
1015 ),
eef868d1 1016
dd45888a 1017 'moodle/site:mnetlogintoremote' => array(
1018 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
3924b988 1019 'captype' => 'read',
dd45888a 1020 'contextlevel' => CONTEXT_SYSTEM,
3924b988 1021 'legacy' => array(
3924b988 1022 'admin' => CAP_ALLOW
1023 )
1024 ),
eef868d1 1025
dd45888a 1026 'moodle/grade:viewall' => array(
bcdb0f19 1027 'riskbitmask' => RISK_PERSONAL,
dd45888a 1028 'captype' => 'read',
eecf76df 1029 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_USER
3924b988 1030 'legacy' => array(
dd45888a 1031 'teacher' => CAP_ALLOW,
3924b988 1032 'editingteacher' => CAP_ALLOW,
3924b988 1033 'admin' => CAP_ALLOW
dd45888a 1034 ),
1035 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
f509ce06 1036 ),
f43ce1ad 1037
dd45888a 1038 'moodle/grade:view' => array(
f509ce06 1039 'captype' => 'read',
eecf76df 1040 'contextlevel' => CONTEXT_COURSE,
f509ce06 1041 'legacy' => array(
dd45888a 1042 'student' => CAP_ALLOW
f509ce06 1043 )
ca9ffa18 1044 ),
dd45888a 1045
1046 'moodle/grade:viewhidden' => array(
ca9ffa18 1047 'riskbitmask' => RISK_PERSONAL,
1048 'captype' => 'read',
eecf76df 1049 'contextlevel' => CONTEXT_COURSE,
ca9ffa18 1050 'legacy' => array(
0371f8e5 1051 'teacher' => CAP_ALLOW,
1052 'editingteacher' => CAP_ALLOW,
1053 'admin' => CAP_ALLOW
dd45888a 1054 ),
1055 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
ca9ffa18 1056 ),
dd45888a 1057
1058 'moodle/grade:import' => array(
3a0c6cca 1059 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
dd45888a 1060 'captype' => 'write',
ca9ffa18 1061 'contextlevel' => CONTEXT_COURSE,
1062 'legacy' => array(
ca9ffa18 1063 'editingteacher' => CAP_ALLOW,
1064 'admin' => CAP_ALLOW
dd45888a 1065 ),
1066 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1067 ),
dd45888a 1068
1069 'moodle/grade:export' => array(
ca9ffa18 1070 'riskbitmask' => RISK_PERSONAL,
1071 'captype' => 'read',
1072 'contextlevel' => CONTEXT_COURSE,
1073 'legacy' => array(
1074 'teacher' => CAP_ALLOW,
1075 'editingteacher' => CAP_ALLOW,
1076 'admin' => CAP_ALLOW
dd45888a 1077 ),
1078 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1079 ),
dd45888a 1080
1081 'moodle/grade:manage' => array(
3a0c6cca 1082 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
dd45888a 1083 'captype' => 'write',
1084 'contextlevel' => CONTEXT_COURSE,
ca9ffa18 1085 'legacy' => array(
dd45888a 1086 'editingteacher' => CAP_ALLOW,
ca9ffa18 1087 'admin' => CAP_ALLOW
dd45888a 1088 ),
1089 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1090 ),
dd45888a 1091
a5b8be62 1092 'moodle/grade:edit' => array(
1093 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
04259694 1094 'captype' => 'write',
1095 'contextlevel' => CONTEXT_COURSE,
1096 'legacy' => array(
1097 'editingteacher' => CAP_ALLOW,
1098 'admin' => CAP_ALLOW
1099 ),
1100 'clonepermissionsfrom' => 'moodle/course:managegrades'
1101 ),
1102
a5b8be62 1103 'moodle/grade:manageoutcomes' => array(
284abb09 1104 'captype' => 'write',
1105 'contextlevel' => CONTEXT_COURSE,
1106 'legacy' => array(
1107 'editingteacher' => CAP_ALLOW,
1108 'admin' => CAP_ALLOW
1109 ),
1110 'clonepermissionsfrom' => 'moodle/course:managegrades'
1111 ),
1112
1113 'moodle/grade:manageletters' => array(
ca9ffa18 1114 'captype' => 'write',
1115 'contextlevel' => CONTEXT_COURSE,
1116 'legacy' => array(
1117 'editingteacher' => CAP_ALLOW,
1118 'admin' => CAP_ALLOW
a5b8be62 1119 ),
1120 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1121 ),
dd45888a 1122
a5b8be62 1123 'moodle/grade:hide' => array(
ca9ffa18 1124 'captype' => 'write',
1125 'contextlevel' => CONTEXT_COURSE,
1126 'legacy' => array(
1127 'editingteacher' => CAP_ALLOW,
1128 'admin' => CAP_ALLOW
1129 )
1130 ),
dd45888a 1131
a5b8be62 1132 'moodle/grade:lock' => array(
dd45888a 1133 'captype' => 'write',
ca9ffa18 1134 'contextlevel' => CONTEXT_COURSE,
1135 'legacy' => array(
1136 'editingteacher' => CAP_ALLOW,
1137 'admin' => CAP_ALLOW
1138 )
1139 ),
dd45888a 1140
a5b8be62 1141 'moodle/grade:unlock' => array(
ca9ffa18 1142 'captype' => 'write',
1143 'contextlevel' => CONTEXT_COURSE,
1144 'legacy' => array(
1145 'editingteacher' => CAP_ALLOW,
1146 'admin' => CAP_ALLOW
1147 )
282c1695 1148 ),
dd45888a 1149
1150 'moodle/my:manageblocks' => array(
282c1695 1151 'captype' => 'write',
1152 'contextlevel' => CONTEXT_SYSTEM,
1153 'legacy' => array(
1154 'user' => CAP_ALLOW
1155 )
eca3af25 1156 ),
dd45888a 1157
eca3af25 1158 'moodle/notes:view' => array(
1159 'captype' => 'read',
1160 'contextlevel' => CONTEXT_SYSTEM,
1161 'legacy' => array(
1162 'teacher' => CAP_ALLOW,
1163 'editingteacher' => CAP_ALLOW,
1164 'admin' => CAP_ALLOW
1165 )
1166 ),
1167
1168 'moodle/notes:manage' => array(
3a0c6cca 1169 'riskbitmask' => RISK_SPAM,
1170
eca3af25 1171 'captype' => 'write',
1172 'contextlevel' => CONTEXT_SYSTEM,
1173 'legacy' => array(
1174 'teacher' => CAP_ALLOW,
1175 'editingteacher' => CAP_ALLOW,
1176 'admin' => CAP_ALLOW
1177 )
dd45888a 1178 ),
79642064 1179
1180 'moodle/tag:manage' => array(
3a0c6cca 1181 'riskbitmask' => RISK_SPAM,
1182
79642064 1183 'captype' => 'write',
1184 'contextlevel' => CONTEXT_SYSTEM,
1185 'legacy' => array(
1186 'teacher' => CAP_ALLOW,
1187 'editingteacher' => CAP_ALLOW,
1188 'admin' => CAP_ALLOW
1189 )
705789bd 1190 ),
1191
1192 'moodle/tag:create' => array(
3a0c6cca 1193 'riskbitmask' => RISK_SPAM,
1194
705789bd 1195 'captype' => 'write',
1196 'contextlevel' => CONTEXT_SYSTEM,
1197 'legacy' => array(
0f07c40e 1198 'admin' => CAP_ALLOW,
1199 'user' => CAP_ALLOW
705789bd 1200 )
1201 ),
a5b8be62 1202
705789bd 1203 'moodle/tag:edit' => array(
3a0c6cca 1204 'riskbitmask' => RISK_SPAM,
1205
705789bd 1206 'captype' => 'write',
1207 'contextlevel' => CONTEXT_SYSTEM,
1208 'legacy' => array(
3e6e529f 1209 'admin' => CAP_ALLOW,
1210 'user' => CAP_ALLOW
98b5789d 1211 )
1212 ),
a5b8be62 1213
98b5789d 1214 'moodle/tag:editblocks' => array(
1215 'captype' => 'write',
1216 'contextlevel' => CONTEXT_SYSTEM,
1217 'legacy' => array(
705789bd 1218 'teacher' => CAP_ALLOW,
1219 'editingteacher' => CAP_ALLOW,
1220 'admin' => CAP_ALLOW
1221 )
7e874772 1222 ),
1223
1224 'moodle/block:view' => array(
1225 'captype' => 'read',
1226 'contextlevel' => CONTEXT_BLOCK,
1227 'legacy' => array(
1228 'guest' => CAP_ALLOW,
25a7d980 1229 'user' => CAP_ALLOW,
1230 'student' => CAP_ALLOW,
1231 'teacher' => CAP_ALLOW,
1232 'editingteacher' => CAP_ALLOW,
1233 'coursecreator' => CAP_ALLOW
7e874772 1234 )
79642064 1235 )
bbbf2d40 1236);
1237
98b5789d 1238
bbbf2d40 1239?>