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