MDL-14741: better default layout for buttons and added new moodlenolink plugin
[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 ),
eef868d1 833
271e6dec 834 'moodle/question:managecategory' => array(
21b6db6e 835
945f88ca 836 'captype' => 'write',
837 'contextlevel' => CONTEXT_COURSE,
838 'legacy' => array(
945f88ca 839 'editingteacher' => CAP_ALLOW,
945f88ca 840 'admin' => CAP_ALLOW
841 )
a5b8be62 842 ),
843
271e6dec 844 //new in moodle 1.9
845 'moodle/question:add' => array(
846 'riskbitmask' => RISK_SPAM,
847 'captype' => 'write',
848 'contextlevel' => CONTEXT_COURSE,
849 'legacy' => array(
850 'editingteacher' => CAP_ALLOW,
851 'admin' => CAP_ALLOW
852 ),
853 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 854 ),
271e6dec 855 'moodle/question:editmine' => array(
856 'riskbitmask' => RISK_SPAM,
857 'captype' => 'write',
858 'contextlevel' => CONTEXT_COURSE,
859 'legacy' => array(
860 'editingteacher' => CAP_ALLOW,
861 'admin' => CAP_ALLOW
862 ),
a5b8be62 863 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 864 ),
865 'moodle/question:editall' => array(
866 'riskbitmask' => RISK_SPAM,
867 'captype' => 'write',
868 'contextlevel' => CONTEXT_COURSE,
869 'legacy' => array(
870 'editingteacher' => CAP_ALLOW,
871 'admin' => CAP_ALLOW
872 ),
a5b8be62 873 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 874 ),
875 'moodle/question:viewmine' => array(
945f88ca 876 'captype' => 'read',
877 'contextlevel' => CONTEXT_COURSE,
878 'legacy' => array(
945f88ca 879 'editingteacher' => CAP_ALLOW,
945f88ca 880 'admin' => CAP_ALLOW
271e6dec 881 ),
a5b8be62 882 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 883 ),
271e6dec 884 'moodle/question:viewall' => array(
885 'captype' => 'read',
886 'contextlevel' => CONTEXT_COURSE,
887 'legacy' => array(
888 'editingteacher' => CAP_ALLOW,
889 'admin' => CAP_ALLOW
890 ),
a5b8be62 891 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 892 ),
893 'moodle/question:usemine' => array(
894 'captype' => 'read',
895 'contextlevel' => CONTEXT_COURSE,
896 'legacy' => array(
897 'editingteacher' => CAP_ALLOW,
898 'admin' => CAP_ALLOW
899 ),
a5b8be62 900 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 901 ),
902 'moodle/question:useall' => array(
903 'captype' => 'read',
904 'contextlevel' => CONTEXT_COURSE,
905 'legacy' => array(
906 'editingteacher' => CAP_ALLOW,
907 'admin' => CAP_ALLOW
908 ),
a5b8be62 909 'clonepermissionsfrom' => 'moodle/question:manage'
910 ),
271e6dec 911 'moodle/question:movemine' => array(
945f88ca 912 'captype' => 'write',
913 'contextlevel' => CONTEXT_COURSE,
914 'legacy' => array(
945f88ca 915 'editingteacher' => CAP_ALLOW,
945f88ca 916 'admin' => CAP_ALLOW
271e6dec 917 ),
a5b8be62 918 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 919 ),
271e6dec 920 'moodle/question:moveall' => array(
945f88ca 921 'captype' => 'write',
922 'contextlevel' => CONTEXT_COURSE,
923 'legacy' => array(
945f88ca 924 'editingteacher' => CAP_ALLOW,
945f88ca 925 'admin' => CAP_ALLOW
271e6dec 926 ),
a5b8be62 927 'clonepermissionsfrom' => 'moodle/question:manage'
7191a1fa 928 ),
271e6dec 929 //END new in moodle 1.9
a5b8be62 930
0eb6b04a 931 // Configure the installed question types.
932 'moodle/question:config' => array(
933
934 'riskbitmask' => RISK_CONFIG,
935
936 'captype' => 'write',
937 'contextlevel' => CONTEXT_SYSTEM,
938 'legacy' => array(
939 'admin' => CAP_ALLOW
940 )
941 ),
942
7191a1fa 943 'moodle/site:doclinks' => array(
bcdb0f19 944
7191a1fa 945 'captype' => 'read',
946 'contextlevel' => CONTEXT_SYSTEM,
947 'legacy' => array(
7191a1fa 948 'teacher' => CAP_ALLOW,
949 'editingteacher' => CAP_ALLOW,
7191a1fa 950 'admin' => CAP_ALLOW
951 )
3924b988 952 ),
eef868d1 953
3924b988 954 'moodle/course:sectionvisibility' => array(
bcdb0f19 955
3924b988 956 'captype' => 'write',
957 'contextlevel' => CONTEXT_COURSE,
958 'legacy' => array(
3924b988 959 'editingteacher' => CAP_ALLOW,
3924b988 960 'admin' => CAP_ALLOW
961 )
962 ),
eef868d1 963
dc558690 964 'moodle/course:useremail' => array(
bcdb0f19 965
dc558690 966 'captype' => 'write',
967 'contextlevel' => CONTEXT_COURSE,
968 'legacy' => array(
dc558690 969 'editingteacher' => CAP_ALLOW,
dc558690 970 'admin' => CAP_ALLOW
971 )
972 ),
eef868d1 973
3924b988 974 'moodle/course:viewhiddensections' => array(
bcdb0f19 975
3924b988 976 'captype' => 'write',
977 'contextlevel' => CONTEXT_COURSE,
978 'legacy' => array(
3924b988 979 'editingteacher' => CAP_ALLOW,
3924b988 980 'admin' => CAP_ALLOW
981 )
982 ),
eef868d1 983
3924b988 984 'moodle/course:setcurrentsection' => array(
bcdb0f19 985
3924b988 986 'captype' => 'write',
987 'contextlevel' => CONTEXT_COURSE,
988 'legacy' => array(
3924b988 989 'editingteacher' => CAP_ALLOW,
3924b988 990 'admin' => CAP_ALLOW
991 )
992 ),
eef868d1 993
dd45888a 994 'moodle/site:mnetlogintoremote' => array(
995 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
3924b988 996 'captype' => 'read',
dd45888a 997 'contextlevel' => CONTEXT_SYSTEM,
3924b988 998 'legacy' => array(
3924b988 999 'admin' => CAP_ALLOW
1000 )
1001 ),
eef868d1 1002
dd45888a 1003 'moodle/grade:viewall' => array(
bcdb0f19 1004 'riskbitmask' => RISK_PERSONAL,
dd45888a 1005 'captype' => 'read',
eecf76df 1006 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_USER
3924b988 1007 'legacy' => array(
dd45888a 1008 'teacher' => CAP_ALLOW,
3924b988 1009 'editingteacher' => CAP_ALLOW,
3924b988 1010 'admin' => CAP_ALLOW
dd45888a 1011 ),
1012 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
f509ce06 1013 ),
f43ce1ad 1014
dd45888a 1015 'moodle/grade:view' => array(
f509ce06 1016 'captype' => 'read',
eecf76df 1017 'contextlevel' => CONTEXT_COURSE,
f509ce06 1018 'legacy' => array(
dd45888a 1019 'student' => CAP_ALLOW
f509ce06 1020 )
ca9ffa18 1021 ),
dd45888a 1022
1023 'moodle/grade:viewhidden' => array(
ca9ffa18 1024 'riskbitmask' => RISK_PERSONAL,
1025 'captype' => 'read',
eecf76df 1026 'contextlevel' => CONTEXT_COURSE,
ca9ffa18 1027 'legacy' => array(
0371f8e5 1028 'teacher' => CAP_ALLOW,
1029 'editingteacher' => CAP_ALLOW,
1030 'admin' => CAP_ALLOW
dd45888a 1031 ),
1032 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
ca9ffa18 1033 ),
dd45888a 1034
1035 'moodle/grade:import' => array(
3a0c6cca 1036 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
dd45888a 1037 'captype' => 'write',
ca9ffa18 1038 'contextlevel' => CONTEXT_COURSE,
1039 'legacy' => array(
ca9ffa18 1040 'editingteacher' => CAP_ALLOW,
1041 'admin' => CAP_ALLOW
dd45888a 1042 ),
1043 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1044 ),
dd45888a 1045
1046 'moodle/grade:export' => array(
ca9ffa18 1047 'riskbitmask' => RISK_PERSONAL,
1048 'captype' => 'read',
1049 'contextlevel' => CONTEXT_COURSE,
1050 'legacy' => array(
1051 'teacher' => CAP_ALLOW,
1052 'editingteacher' => CAP_ALLOW,
1053 'admin' => CAP_ALLOW
dd45888a 1054 ),
1055 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1056 ),
dd45888a 1057
1058 'moodle/grade:manage' => array(
3a0c6cca 1059 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
dd45888a 1060 'captype' => 'write',
1061 'contextlevel' => CONTEXT_COURSE,
ca9ffa18 1062 'legacy' => array(
dd45888a 1063 'editingteacher' => CAP_ALLOW,
ca9ffa18 1064 'admin' => CAP_ALLOW
dd45888a 1065 ),
1066 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1067 ),
dd45888a 1068
a5b8be62 1069 'moodle/grade:edit' => array(
1070 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
04259694 1071 'captype' => 'write',
1072 'contextlevel' => CONTEXT_COURSE,
1073 'legacy' => array(
1074 'editingteacher' => CAP_ALLOW,
1075 'admin' => CAP_ALLOW
1076 ),
1077 'clonepermissionsfrom' => 'moodle/course:managegrades'
1078 ),
1079
a5b8be62 1080 'moodle/grade:manageoutcomes' => array(
284abb09 1081 'captype' => 'write',
1082 'contextlevel' => CONTEXT_COURSE,
1083 'legacy' => array(
1084 'editingteacher' => CAP_ALLOW,
1085 'admin' => CAP_ALLOW
1086 ),
1087 'clonepermissionsfrom' => 'moodle/course:managegrades'
1088 ),
1089
1090 'moodle/grade:manageletters' => array(
ca9ffa18 1091 'captype' => 'write',
1092 'contextlevel' => CONTEXT_COURSE,
1093 'legacy' => array(
1094 'editingteacher' => CAP_ALLOW,
1095 'admin' => CAP_ALLOW
a5b8be62 1096 ),
1097 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1098 ),
dd45888a 1099
a5b8be62 1100 'moodle/grade:hide' => array(
ca9ffa18 1101 'captype' => 'write',
1102 'contextlevel' => CONTEXT_COURSE,
1103 'legacy' => array(
1104 'editingteacher' => CAP_ALLOW,
1105 'admin' => CAP_ALLOW
1106 )
1107 ),
dd45888a 1108
a5b8be62 1109 'moodle/grade:lock' => array(
dd45888a 1110 'captype' => 'write',
ca9ffa18 1111 'contextlevel' => CONTEXT_COURSE,
1112 'legacy' => array(
1113 'editingteacher' => CAP_ALLOW,
1114 'admin' => CAP_ALLOW
1115 )
1116 ),
dd45888a 1117
a5b8be62 1118 'moodle/grade:unlock' => array(
ca9ffa18 1119 'captype' => 'write',
1120 'contextlevel' => CONTEXT_COURSE,
1121 'legacy' => array(
1122 'editingteacher' => CAP_ALLOW,
1123 'admin' => CAP_ALLOW
1124 )
282c1695 1125 ),
dd45888a 1126
1127 'moodle/my:manageblocks' => array(
282c1695 1128 'captype' => 'write',
1129 'contextlevel' => CONTEXT_SYSTEM,
1130 'legacy' => array(
1131 'user' => CAP_ALLOW
1132 )
eca3af25 1133 ),
dd45888a 1134
eca3af25 1135 'moodle/notes:view' => array(
1136 'captype' => 'read',
1137 'contextlevel' => CONTEXT_SYSTEM,
1138 'legacy' => array(
1139 'teacher' => CAP_ALLOW,
1140 'editingteacher' => CAP_ALLOW,
1141 'admin' => CAP_ALLOW
1142 )
1143 ),
1144
1145 'moodle/notes:manage' => array(
3a0c6cca 1146 'riskbitmask' => RISK_SPAM,
1147
eca3af25 1148 'captype' => 'write',
1149 'contextlevel' => CONTEXT_SYSTEM,
1150 'legacy' => array(
1151 'teacher' => CAP_ALLOW,
1152 'editingteacher' => CAP_ALLOW,
1153 'admin' => CAP_ALLOW
1154 )
dd45888a 1155 ),
79642064 1156
1157 'moodle/tag:manage' => array(
3a0c6cca 1158 'riskbitmask' => RISK_SPAM,
1159
79642064 1160 'captype' => 'write',
1161 'contextlevel' => CONTEXT_SYSTEM,
1162 'legacy' => array(
1163 'teacher' => CAP_ALLOW,
1164 'editingteacher' => CAP_ALLOW,
1165 'admin' => CAP_ALLOW
1166 )
705789bd 1167 ),
1168
1169 'moodle/tag:create' => array(
3a0c6cca 1170 'riskbitmask' => RISK_SPAM,
1171
705789bd 1172 'captype' => 'write',
1173 'contextlevel' => CONTEXT_SYSTEM,
1174 'legacy' => array(
0f07c40e 1175 'admin' => CAP_ALLOW,
1176 'user' => CAP_ALLOW
705789bd 1177 )
1178 ),
a5b8be62 1179
705789bd 1180 'moodle/tag:edit' => array(
3a0c6cca 1181 'riskbitmask' => RISK_SPAM,
1182
705789bd 1183 'captype' => 'write',
1184 'contextlevel' => CONTEXT_SYSTEM,
1185 'legacy' => array(
3e6e529f 1186 'admin' => CAP_ALLOW,
1187 'user' => CAP_ALLOW
98b5789d 1188 )
1189 ),
a5b8be62 1190
98b5789d 1191 'moodle/tag:editblocks' => array(
1192 'captype' => 'write',
1193 'contextlevel' => CONTEXT_SYSTEM,
1194 'legacy' => array(
705789bd 1195 'teacher' => CAP_ALLOW,
1196 'editingteacher' => CAP_ALLOW,
1197 'admin' => CAP_ALLOW
1198 )
7e874772 1199 ),
1200
1201 'moodle/block:view' => array(
1202 'captype' => 'read',
1203 'contextlevel' => CONTEXT_BLOCK,
1204 'legacy' => array(
1205 'guest' => CAP_ALLOW,
25a7d980 1206 'user' => CAP_ALLOW,
1207 'student' => CAP_ALLOW,
1208 'teacher' => CAP_ALLOW,
1209 'editingteacher' => CAP_ALLOW,
1210 'coursecreator' => CAP_ALLOW
7e874772 1211 )
79642064 1212 )
bbbf2d40 1213);
1214
98b5789d 1215
bbbf2d40 1216?>