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