MDL-14624:
[moodle-linuxchix.git] / lib / db / access.php
blob3bb9f05fbc1c99263a61d3a943459604eed20d04
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).
13 // CAPABILITY NAMING CONVENTION
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>
19 // component_name should be the same as the directory name of the mod or block.
21 // Core moodle capabilities are defined thus:
22 // moodle/<capabilityclass>:<capabilityname>
24 // Examples: mod/forum:viewpost
25 // block/recent_activity:view
26 // moodle/site:deleteuser
28 // The variable name for the capability definitions array follows the format
29 // $<componenttype>_<component_name>_capabilities
31 // For the core capabilities, the variable is $moodle_capabilities.
34 $moodle_capabilities = array(
36 'moodle/site:doanything' => array(
38 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
40 'captype' => 'admin',
41 'contextlevel' => CONTEXT_SYSTEM
44 'moodle/legacy:guest' => array(
46 'captype' => 'legacy',
47 'contextlevel' => CONTEXT_SYSTEM
50 'moodle/legacy:user' => array(
52 'captype' => 'legacy',
53 'contextlevel' => CONTEXT_SYSTEM
56 'moodle/legacy:student' => array(
58 'riskbitmask' => RISK_SPAM,
60 'captype' => 'legacy',
61 'contextlevel' => CONTEXT_SYSTEM
65 'moodle/legacy:teacher' => array(
67 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
69 'captype' => 'legacy',
70 'contextlevel' => CONTEXT_SYSTEM
74 'moodle/legacy:editingteacher' => array(
76 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
78 'captype' => 'legacy',
79 'contextlevel' => CONTEXT_SYSTEM
83 'moodle/legacy:coursecreator' => array(
85 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
87 'captype' => 'legacy',
88 'contextlevel' => CONTEXT_SYSTEM
92 'moodle/legacy:admin' => array(
94 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
96 'captype' => 'legacy',
97 'contextlevel' => CONTEXT_SYSTEM
101 'moodle/site:config' => array(
103 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
105 'captype' => 'write',
106 'contextlevel' => CONTEXT_SYSTEM,
107 'legacy' => array(
108 'admin' => CAP_ALLOW
112 'moodle/site:readallmessages' => array(
114 'riskbitmask' => RISK_PERSONAL,
116 'captype' => 'read',
117 'contextlevel' => CONTEXT_SYSTEM,
118 'legacy' => array(
119 'admin' => CAP_ALLOW,
120 'editingteacher' => CAP_ALLOW
124 'moodle/site:sendmessage' => array(
126 'riskbitmask' => RISK_PERSONAL,
128 'captype' => 'write',
129 'contextlevel' => CONTEXT_SYSTEM,
130 'legacy' => array(
131 'admin' => CAP_ALLOW,
132 'user' => CAP_ALLOW
136 'moodle/site:approvecourse' => array(
138 'riskbitmask' => RISK_XSS,
140 'captype' => 'write',
141 'contextlevel' => CONTEXT_SYSTEM,
142 'legacy' => array(
143 'admin' => CAP_ALLOW
147 'moodle/site:import' => array(
149 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
151 'captype' => 'write',
152 'contextlevel' => CONTEXT_SYSTEM,
153 'legacy' => array(
154 'editingteacher' => CAP_ALLOW,
155 'admin' => CAP_ALLOW
159 'moodle/site:backup' => array(
161 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
163 'captype' => 'write',
164 'contextlevel' => CONTEXT_SYSTEM,
165 'legacy' => array(
166 'editingteacher' => CAP_ALLOW,
167 'admin' => CAP_ALLOW
171 'moodle/site:restore' => array(
173 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
175 'captype' => 'write',
176 'contextlevel' => CONTEXT_SYSTEM,
177 'legacy' => array(
178 'editingteacher' => CAP_ALLOW,
179 'admin' => CAP_ALLOW
183 'moodle/site:manageblocks' => array(
185 'riskbitmask' => RISK_SPAM | RISK_XSS,
187 'captype' => 'write',
188 'contextlevel' => CONTEXT_SYSTEM,
189 'legacy' => array(
190 'editingteacher' => CAP_ALLOW,
191 'admin' => CAP_ALLOW
195 'moodle/site:accessallgroups' => array(
197 'captype' => 'read',
198 'contextlevel' => CONTEXT_SYSTEM,
199 'legacy' => array(
200 'teacher' => CAP_ALLOW,
201 'editingteacher' => CAP_ALLOW,
202 'admin' => CAP_ALLOW
206 'moodle/site:viewfullnames' => array(
208 'captype' => 'read',
209 'contextlevel' => CONTEXT_SYSTEM,
210 'legacy' => array(
211 'teacher' => CAP_ALLOW,
212 'editingteacher' => CAP_ALLOW,
213 'admin' => CAP_ALLOW
217 'moodle/site:viewreports' => array(
219 'riskbitmask' => RISK_PERSONAL,
221 'captype' => 'read',
222 'contextlevel' => CONTEXT_SYSTEM,
223 'legacy' => array(
224 'teacher' => CAP_ALLOW,
225 'editingteacher' => CAP_ALLOW,
226 'admin' => CAP_ALLOW
230 'moodle/site:trustcontent' => array(
232 'riskbitmask' => RISK_XSS,
234 'captype' => 'write',
235 'contextlevel' => CONTEXT_SYSTEM,
236 'legacy' => array(
237 'editingteacher' => CAP_ALLOW,
238 'admin' => CAP_ALLOW
242 'moodle/site:uploadusers' => array(
244 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
246 'captype' => 'write',
247 'contextlevel' => CONTEXT_SYSTEM,
248 'legacy' => array(
249 'admin' => CAP_ALLOW
253 'moodle/site:langeditmaster' => array(
255 'riskbitmask' => RISK_CONFIG | RISK_XSS,
257 'captype' => 'write',
258 'contextlevel' => CONTEXT_SYSTEM,
259 'legacy' => array(
260 'admin' => CAP_PREVENT
264 'moodle/site:langeditlocal' => array(
266 'riskbitmask' => RISK_CONFIG | RISK_XSS,
268 'captype' => 'write',
269 'contextlevel' => CONTEXT_SYSTEM,
270 'legacy' => array(
271 'admin' => CAP_ALLOW
276 'moodle/user:create' => array(
278 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
280 'captype' => 'write',
281 'contextlevel' => CONTEXT_SYSTEM,
282 'legacy' => array(
283 'admin' => CAP_ALLOW
287 'moodle/user:delete' => array(
289 'riskbitmask' => RISK_PERSONAL,
291 'captype' => 'write',
292 'contextlevel' => CONTEXT_SYSTEM,
293 'legacy' => array(
294 'admin' => CAP_ALLOW
298 'moodle/user:update' => array(
300 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
302 'captype' => 'write',
303 'contextlevel' => CONTEXT_SYSTEM,
304 'legacy' => array(
305 'admin' => CAP_ALLOW
309 'moodle/user:viewdetails' => array(
311 'captype' => 'read',
312 'contextlevel' => CONTEXT_SYSTEM,
313 'legacy' => array(
314 'guest' => CAP_ALLOW,
315 'student' => CAP_ALLOW,
316 'teacher' => CAP_ALLOW,
317 'editingteacher' => CAP_ALLOW,
318 'admin' => CAP_ALLOW
322 'moodle/user:viewhiddendetails' => array(
324 'riskbitmask' => RISK_PERSONAL,
326 'captype' => 'read',
327 'contextlevel' => CONTEXT_SYSTEM,
328 'legacy' => array(
329 'teacher' => CAP_ALLOW,
330 'editingteacher' => CAP_ALLOW,
331 'admin' => CAP_ALLOW
335 'moodle/user:loginas' => array(
337 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
339 'captype' => 'write',
340 'contextlevel' => CONTEXT_COURSE,
341 'legacy' => array(
342 'admin' => CAP_ALLOW
346 'moodle/role:assign' => array(
348 'captype' => 'write',
349 'contextlevel' => CONTEXT_SYSTEM,
350 'legacy' => array(
351 'editingteacher' => CAP_ALLOW,
352 'admin' => CAP_ALLOW
356 'moodle/role:override' => array(
358 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
360 'captype' => 'write',
361 'contextlevel' => CONTEXT_SYSTEM,
362 'legacy' => array(
363 'admin' => CAP_ALLOW
367 'moodle/role:manage' => array(
369 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
371 'captype' => 'write',
372 'contextlevel' => CONTEXT_SYSTEM,
373 'legacy' => array(
374 'admin' => CAP_ALLOW
378 'moodle/role:unassignself' => array(
380 'captype' => 'write',
381 'contextlevel' => CONTEXT_SYSTEM,
382 'legacy' => array(
383 'student' => (empty($CFG->allowunenrol)) ? CAP_INHERIT : CAP_ALLOW,
384 'teacher' => CAP_ALLOW,
385 'editingteacher' => CAP_ALLOW,
386 'coursecreator' => CAP_ALLOW,
387 'admin' => CAP_ALLOW
391 'moodle/role:viewhiddenassigns' => array(
393 'captype' => 'read',
394 'contextlevel' => CONTEXT_SYSTEM,
395 'legacy' => array(
396 'teacher' => CAP_ALLOW,
397 'editingteacher' => CAP_ALLOW,
398 'admin' => CAP_ALLOW
402 'moodle/role:switchroles' => array(
404 'riskbitmask' => RISK_XSS,
406 'captype' => 'read',
407 'contextlevel' => CONTEXT_SYSTEM,
408 'legacy' => array(
409 'editingteacher' => CAP_ALLOW,
410 'admin' => CAP_ALLOW
414 'moodle/category:create' => array(
416 'riskbitmask' => RISK_XSS,
418 'captype' => 'write',
419 'contextlevel' => CONTEXT_COURSECAT,
420 'legacy' => array(
421 'admin' => CAP_ALLOW
425 'moodle/category:delete' => array(
427 'captype' => 'write',
428 'contextlevel' => CONTEXT_COURSECAT,
429 'legacy' => array(
430 'admin' => CAP_ALLOW
434 'moodle/category:update' => array(
436 'riskbitmask' => RISK_XSS,
438 'captype' => 'write',
439 'contextlevel' => CONTEXT_COURSECAT,
440 'legacy' => array(
441 'admin' => CAP_ALLOW
445 'moodle/category:visibility' => array(
447 'captype' => 'write',
448 'contextlevel' => CONTEXT_COURSECAT,
449 'legacy' => array(
450 'admin' => CAP_ALLOW
454 'moodle/course:create' => array(
456 'riskbitmask' => RISK_XSS,
458 'captype' => 'write',
459 'contextlevel' => CONTEXT_COURSECAT,
460 'legacy' => array(
461 'coursecreator' => CAP_ALLOW,
462 'admin' => CAP_ALLOW
466 'moodle/course:delete' => array(
468 'captype' => 'write',
469 'contextlevel' => CONTEXT_COURSE,
470 'legacy' => array(
471 'admin' => CAP_ALLOW
475 'moodle/course:update' => array(
477 'riskbitmask' => RISK_XSS,
479 'captype' => 'write',
480 'contextlevel' => CONTEXT_COURSE,
481 'legacy' => array(
482 'editingteacher' => CAP_ALLOW,
483 'admin' => CAP_ALLOW
487 'moodle/course:view' => array(
489 'captype' => 'read',
490 'contextlevel' => CONTEXT_COURSE,
491 'legacy' => array(
492 'guest' => CAP_ALLOW,
493 'student' => CAP_ALLOW,
494 'teacher' => CAP_ALLOW,
495 'editingteacher' => CAP_ALLOW
499 'moodle/course:bulkmessaging' => array(
501 'riskbitmask' => RISK_SPAM,
503 'captype' => 'write',
504 'contextlevel' => CONTEXT_COURSE,
505 'legacy' => array(
506 'teacher' => CAP_ALLOW,
507 'editingteacher' => CAP_ALLOW,
508 'admin' => CAP_ALLOW
512 'moodle/course:viewhiddenuserfields' => array(
514 'riskbitmask' => RISK_PERSONAL,
516 'captype' => 'read',
517 'contextlevel' => CONTEXT_COURSE,
518 'legacy' => array(
519 'teacher' => CAP_ALLOW,
520 'editingteacher' => CAP_ALLOW,
521 'admin' => CAP_ALLOW
525 'moodle/course:viewhiddencourses' => array(
527 'captype' => 'read',
528 'contextlevel' => CONTEXT_COURSE,
529 'legacy' => array(
530 'coursecreator' => CAP_ALLOW,
531 'teacher' => CAP_ALLOW,
532 'editingteacher' => CAP_ALLOW,
533 'admin' => CAP_ALLOW
537 'moodle/course:visibility' => array(
539 'captype' => 'write',
540 'contextlevel' => CONTEXT_COURSE,
541 'legacy' => array(
542 'admin' => CAP_ALLOW
546 'moodle/course:managefiles' => array(
548 'riskbitmask' => RISK_XSS,
550 'captype' => 'write',
551 'contextlevel' => CONTEXT_COURSE,
552 'legacy' => array(
553 'editingteacher' => CAP_ALLOW,
554 'admin' => CAP_ALLOW
558 'moodle/course:manageactivities' => array(
560 'riskbitmask' => RISK_XSS,
562 'captype' => 'write',
563 'contextlevel' => CONTEXT_COURSE,
564 'legacy' => array(
565 'editingteacher' => CAP_ALLOW,
566 'admin' => CAP_ALLOW
570 'moodle/course:managemetacourse' => array(
572 'captype' => 'write',
573 'contextlevel' => CONTEXT_COURSE,
574 'legacy' => array(
575 'editingteacher' => CAP_ALLOW,
576 'admin' => CAP_ALLOW
580 'moodle/course:activityvisibility' => array(
582 'captype' => 'write',
583 'contextlevel' => CONTEXT_COURSE,
584 'legacy' => array(
585 'editingteacher' => CAP_ALLOW,
586 'admin' => CAP_ALLOW
590 'moodle/course:viewhiddenactivities' => array(
592 'captype' => 'write',
593 'contextlevel' => CONTEXT_COURSE,
594 'legacy' => array(
595 'teacher' => CAP_ALLOW,
596 'editingteacher' => CAP_ALLOW,
597 'admin' => CAP_ALLOW
601 'moodle/course:viewparticipants' => array(
603 'captype' => 'read',
604 'contextlevel' => CONTEXT_COURSE,
605 'legacy' => array(
606 'student' => CAP_ALLOW,
607 'teacher' => CAP_ALLOW,
608 'editingteacher' => CAP_ALLOW,
609 'admin' => CAP_ALLOW
613 'moodle/site:viewparticipants' => array(
615 'captype' => 'read',
616 'contextlevel' => CONTEXT_SYSTEM,
617 'legacy' => array(
618 'admin' => CAP_ALLOW
622 'moodle/course:viewscales' => array(
624 'captype' => 'read',
625 'contextlevel' => CONTEXT_COURSE,
626 'legacy' => array(
627 'student' => CAP_ALLOW,
628 'teacher' => CAP_ALLOW,
629 'editingteacher' => CAP_ALLOW,
630 'admin' => CAP_ALLOW
634 'moodle/course:managescales' => array(
636 'captype' => 'write',
637 'contextlevel' => CONTEXT_COURSE,
638 'legacy' => array(
639 'editingteacher' => CAP_ALLOW,
640 'admin' => CAP_ALLOW
644 'moodle/course:managegroups' => array(
646 'captype' => 'write',
647 'contextlevel' => CONTEXT_COURSE,
648 'legacy' => array(
649 'editingteacher' => CAP_ALLOW,
650 'admin' => CAP_ALLOW
654 'moodle/course:reset' => array(
656 'captype' => 'write',
657 'contextlevel' => CONTEXT_COURSE,
658 'legacy' => array(
659 'editingteacher' => CAP_ALLOW,
660 'admin' => CAP_ALLOW
664 'moodle/blog:view' => array(
666 'captype' => 'read',
667 'contextlevel' => CONTEXT_SYSTEM,
668 'legacy' => array(
669 'guest' => CAP_ALLOW,
670 'user' => CAP_ALLOW,
671 'student' => CAP_ALLOW,
672 'teacher' => CAP_ALLOW,
673 'editingteacher' => CAP_ALLOW,
674 'admin' => CAP_ALLOW
678 'moodle/blog:create' => array( // works in CONTEXT_SYSTEM only
680 'riskbitmask' => RISK_SPAM,
682 'captype' => 'write',
683 'contextlevel' => CONTEXT_SYSTEM,
684 'legacy' => array(
685 'user' => CAP_ALLOW,
686 'admin' => CAP_ALLOW
690 'moodle/blog:manageentries' => array(
692 'riskbitmask' => RISK_SPAM,
694 'captype' => 'write',
695 'contextlevel' => CONTEXT_SYSTEM,
696 'legacy' => array(
697 'teacher' => CAP_ALLOW,
698 'editingteacher' => CAP_ALLOW,
699 'admin' => CAP_ALLOW
703 'moodle/calendar:manageownentries' => array( // works in CONTEXT_SYSTEM only
705 'riskbitmask' => RISK_SPAM,
707 'captype' => 'write',
708 'contextlevel' => CONTEXT_SYSTEM,
709 'legacy' => array(
710 'user' => CAP_ALLOW,
711 'admin' => CAP_ALLOW
715 'moodle/calendar:managegroupentries' => array(
717 'riskbitmask' => RISK_SPAM,
719 'captype' => 'write',
720 'contextlevel' => CONTEXT_SYSTEM,
721 'legacy' => array(
722 'teacher' => CAP_ALLOW,
723 'editingteacher' => CAP_ALLOW,
724 'admin' => CAP_ALLOW
728 'moodle/calendar:manageentries' => array(
730 'riskbitmask' => RISK_SPAM,
732 'captype' => 'write',
733 'contextlevel' => CONTEXT_SYSTEM,
734 'legacy' => array(
735 'teacher' => CAP_ALLOW,
736 'editingteacher' => CAP_ALLOW,
737 'admin' => CAP_ALLOW
741 'moodle/user:editprofile' => array(
743 'riskbitmask' => RISK_SPAM,
745 'captype' => 'write',
746 'contextlevel' => CONTEXT_USER,
747 'legacy' => array(
748 'admin' => CAP_ALLOW
752 'moodle/user:editownprofile' => array(
754 'captype' => 'write',
755 'contextlevel' => CONTEXT_SYSTEM,
756 'legacy' => array(
757 'guest' => CAP_PROHIBIT,
758 'user' => CAP_ALLOW,
759 'admin' => CAP_ALLOW
763 'moodle/user:changeownpassword' => array(
765 'captype' => 'write',
766 'contextlevel' => CONTEXT_SYSTEM,
767 'legacy' => array(
768 'guest' => CAP_PROHIBIT,
769 'user' => CAP_ALLOW,
770 'admin' => CAP_ALLOW
774 // The next 3 might make no sense for some roles, e.g teacher, etc.
775 // since the next level up is site. These are more for the parent role
776 'moodle/user:readuserposts' => array(
778 'captype' => 'read',
779 'contextlevel' => CONTEXT_USER,
780 'legacy' => array(
781 'student' => CAP_ALLOW,
782 'teacher' => CAP_ALLOW,
783 'editingteacher' => CAP_ALLOW,
784 'admin' => CAP_ALLOW
788 'moodle/user:readuserblogs' => array(
790 'captype' => 'read',
791 'contextlevel' => CONTEXT_USER,
792 'legacy' => array(
793 'student' => CAP_ALLOW,
794 'teacher' => CAP_ALLOW,
795 'editingteacher' => CAP_ALLOW,
796 'admin' => CAP_ALLOW
800 'moodle/user:viewuseractivitiesreport' => array(
802 'captype' => 'read',
803 'contextlevel' => CONTEXT_USER,
804 'legacy' => array(
805 'teacher' => CAP_ALLOW,
806 'editingteacher' => CAP_ALLOW,
807 'admin' => CAP_ALLOW
811 'moodle/question:managecategory' => array(
813 'captype' => 'write',
814 'contextlevel' => CONTEXT_COURSE,
815 'legacy' => array(
816 'editingteacher' => CAP_ALLOW,
817 'admin' => CAP_ALLOW
821 //new in moodle 1.9
822 'moodle/question:add' => array(
823 'riskbitmask' => RISK_SPAM,
824 'captype' => 'write',
825 'contextlevel' => CONTEXT_COURSE,
826 'legacy' => array(
827 'editingteacher' => CAP_ALLOW,
828 'admin' => CAP_ALLOW
830 'clonepermissionsfrom' => 'moodle/question:manage'
832 'moodle/question:editmine' => array(
833 'riskbitmask' => RISK_SPAM,
834 'captype' => 'write',
835 'contextlevel' => CONTEXT_COURSE,
836 'legacy' => array(
837 'editingteacher' => CAP_ALLOW,
838 'admin' => CAP_ALLOW
840 'clonepermissionsfrom' => 'moodle/question:manage'
842 'moodle/question:editall' => array(
843 'riskbitmask' => RISK_SPAM,
844 'captype' => 'write',
845 'contextlevel' => CONTEXT_COURSE,
846 'legacy' => array(
847 'editingteacher' => CAP_ALLOW,
848 'admin' => CAP_ALLOW
850 'clonepermissionsfrom' => 'moodle/question:manage'
852 'moodle/question:viewmine' => array(
853 'captype' => 'read',
854 'contextlevel' => CONTEXT_COURSE,
855 'legacy' => array(
856 'editingteacher' => CAP_ALLOW,
857 'admin' => CAP_ALLOW
859 'clonepermissionsfrom' => 'moodle/question:manage'
861 'moodle/question:viewall' => array(
862 'captype' => 'read',
863 'contextlevel' => CONTEXT_COURSE,
864 'legacy' => array(
865 'editingteacher' => CAP_ALLOW,
866 'admin' => CAP_ALLOW
868 'clonepermissionsfrom' => 'moodle/question:manage'
870 'moodle/question:usemine' => array(
871 'captype' => 'read',
872 'contextlevel' => CONTEXT_COURSE,
873 'legacy' => array(
874 'editingteacher' => CAP_ALLOW,
875 'admin' => CAP_ALLOW
877 'clonepermissionsfrom' => 'moodle/question:manage'
879 'moodle/question:useall' => array(
880 'captype' => 'read',
881 'contextlevel' => CONTEXT_COURSE,
882 'legacy' => array(
883 'editingteacher' => CAP_ALLOW,
884 'admin' => CAP_ALLOW
886 'clonepermissionsfrom' => 'moodle/question:manage'
888 'moodle/question:movemine' => array(
889 'captype' => 'write',
890 'contextlevel' => CONTEXT_COURSE,
891 'legacy' => array(
892 'editingteacher' => CAP_ALLOW,
893 'admin' => CAP_ALLOW
895 'clonepermissionsfrom' => 'moodle/question:manage'
897 'moodle/question:moveall' => array(
898 'captype' => 'write',
899 'contextlevel' => CONTEXT_COURSE,
900 'legacy' => array(
901 'editingteacher' => CAP_ALLOW,
902 'admin' => CAP_ALLOW
904 'clonepermissionsfrom' => 'moodle/question:manage'
906 //END new in moodle 1.9
908 // Configure the installed question types.
909 'moodle/question:config' => array(
911 'riskbitmask' => RISK_CONFIG,
913 'captype' => 'write',
914 'contextlevel' => CONTEXT_SYSTEM,
915 'legacy' => array(
916 'admin' => CAP_ALLOW
920 'moodle/site:doclinks' => array(
922 'captype' => 'read',
923 'contextlevel' => CONTEXT_SYSTEM,
924 'legacy' => array(
925 'teacher' => CAP_ALLOW,
926 'editingteacher' => CAP_ALLOW,
927 'admin' => CAP_ALLOW
931 'moodle/course:sectionvisibility' => array(
933 'captype' => 'write',
934 'contextlevel' => CONTEXT_COURSE,
935 'legacy' => array(
936 'editingteacher' => CAP_ALLOW,
937 'admin' => CAP_ALLOW
941 'moodle/course:useremail' => array(
943 'captype' => 'write',
944 'contextlevel' => CONTEXT_COURSE,
945 'legacy' => array(
946 'editingteacher' => CAP_ALLOW,
947 'admin' => CAP_ALLOW
951 'moodle/course:viewhiddensections' => array(
953 'captype' => 'write',
954 'contextlevel' => CONTEXT_COURSE,
955 'legacy' => array(
956 'editingteacher' => CAP_ALLOW,
957 'admin' => CAP_ALLOW
961 'moodle/course:setcurrentsection' => array(
963 'captype' => 'write',
964 'contextlevel' => CONTEXT_COURSE,
965 'legacy' => array(
966 'editingteacher' => CAP_ALLOW,
967 'admin' => CAP_ALLOW
971 'moodle/site:mnetlogintoremote' => array(
972 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
973 'captype' => 'read',
974 'contextlevel' => CONTEXT_SYSTEM,
975 'legacy' => array(
976 'admin' => CAP_ALLOW
980 'moodle/grade:viewall' => array(
981 'riskbitmask' => RISK_PERSONAL,
982 'captype' => 'read',
983 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_USER
984 'legacy' => array(
985 'teacher' => CAP_ALLOW,
986 'editingteacher' => CAP_ALLOW,
987 'admin' => CAP_ALLOW
989 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
992 'moodle/grade:view' => array(
993 'captype' => 'read',
994 'contextlevel' => CONTEXT_COURSE,
995 'legacy' => array(
996 'student' => CAP_ALLOW
1000 'moodle/grade:viewhidden' => array(
1001 'riskbitmask' => RISK_PERSONAL,
1002 'captype' => 'read',
1003 'contextlevel' => CONTEXT_COURSE,
1004 'legacy' => array(
1005 'teacher' => CAP_ALLOW,
1006 'editingteacher' => CAP_ALLOW,
1007 'admin' => CAP_ALLOW
1009 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
1012 'moodle/grade:import' => array(
1013 'riskbitmask' => RISK_PERSONAL,
1014 'captype' => 'write',
1015 'contextlevel' => CONTEXT_COURSE,
1016 'legacy' => array(
1017 'editingteacher' => CAP_ALLOW,
1018 'admin' => CAP_ALLOW
1020 'clonepermissionsfrom' => 'moodle/course:managegrades'
1023 'moodle/grade:export' => array(
1024 'riskbitmask' => RISK_PERSONAL,
1025 'captype' => 'read',
1026 'contextlevel' => CONTEXT_COURSE,
1027 'legacy' => array(
1028 'teacher' => CAP_ALLOW,
1029 'editingteacher' => CAP_ALLOW,
1030 'admin' => CAP_ALLOW
1032 'clonepermissionsfrom' => 'moodle/course:managegrades'
1035 'moodle/grade:manage' => array(
1036 'riskbitmask' => RISK_PERSONAL,
1037 'captype' => 'write',
1038 'contextlevel' => CONTEXT_COURSE,
1039 'legacy' => array(
1040 'editingteacher' => CAP_ALLOW,
1041 'admin' => CAP_ALLOW
1043 'clonepermissionsfrom' => 'moodle/course:managegrades'
1046 'moodle/grade:edit' => array(
1047 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
1048 'captype' => 'write',
1049 'contextlevel' => CONTEXT_COURSE,
1050 'legacy' => array(
1051 'editingteacher' => CAP_ALLOW,
1052 'admin' => CAP_ALLOW
1054 'clonepermissionsfrom' => 'moodle/course:managegrades'
1057 'moodle/grade:manageoutcomes' => array(
1058 'captype' => 'write',
1059 'contextlevel' => CONTEXT_COURSE,
1060 'legacy' => array(
1061 'editingteacher' => CAP_ALLOW,
1062 'admin' => CAP_ALLOW
1064 'clonepermissionsfrom' => 'moodle/course:managegrades'
1067 'moodle/grade:manageletters' => array(
1068 'captype' => 'write',
1069 'contextlevel' => CONTEXT_COURSE,
1070 'legacy' => array(
1071 'editingteacher' => CAP_ALLOW,
1072 'admin' => CAP_ALLOW
1074 'clonepermissionsfrom' => 'moodle/course:managegrades'
1077 'moodle/grade:hide' => array(
1078 'captype' => 'write',
1079 'contextlevel' => CONTEXT_COURSE,
1080 'legacy' => array(
1081 'editingteacher' => CAP_ALLOW,
1082 'admin' => CAP_ALLOW
1086 'moodle/grade:lock' => array(
1087 'captype' => 'write',
1088 'contextlevel' => CONTEXT_COURSE,
1089 'legacy' => array(
1090 'editingteacher' => CAP_ALLOW,
1091 'admin' => CAP_ALLOW
1095 'moodle/grade:unlock' => array(
1096 'captype' => 'write',
1097 'contextlevel' => CONTEXT_COURSE,
1098 'legacy' => array(
1099 'editingteacher' => CAP_ALLOW,
1100 'admin' => CAP_ALLOW
1104 'moodle/my:manageblocks' => array(
1105 'captype' => 'write',
1106 'contextlevel' => CONTEXT_SYSTEM,
1107 'legacy' => array(
1108 'user' => CAP_ALLOW
1112 'moodle/notes:view' => array(
1113 'captype' => 'read',
1114 'contextlevel' => CONTEXT_SYSTEM,
1115 'legacy' => array(
1116 'teacher' => CAP_ALLOW,
1117 'editingteacher' => CAP_ALLOW,
1118 'admin' => CAP_ALLOW
1122 'moodle/notes:manage' => array(
1123 'captype' => 'write',
1124 'contextlevel' => CONTEXT_SYSTEM,
1125 'legacy' => array(
1126 'teacher' => CAP_ALLOW,
1127 'editingteacher' => CAP_ALLOW,
1128 'admin' => CAP_ALLOW
1132 'moodle/tag:manage' => array(
1133 'captype' => 'write',
1134 'contextlevel' => CONTEXT_SYSTEM,
1135 'legacy' => array(
1136 'teacher' => CAP_ALLOW,
1137 'editingteacher' => CAP_ALLOW,
1138 'admin' => CAP_ALLOW
1142 'moodle/tag:create' => array(
1143 'captype' => 'write',
1144 'contextlevel' => CONTEXT_SYSTEM,
1145 'legacy' => array(
1146 'admin' => CAP_ALLOW,
1147 'user' => CAP_ALLOW
1151 'moodle/tag:edit' => array(
1152 'captype' => 'write',
1153 'contextlevel' => CONTEXT_SYSTEM,
1154 'legacy' => array(
1155 'admin' => CAP_ALLOW,
1156 'user' => CAP_ALLOW
1160 'moodle/tag:editblocks' => array(
1161 'captype' => 'write',
1162 'contextlevel' => CONTEXT_SYSTEM,
1163 'legacy' => array(
1164 'teacher' => CAP_ALLOW,
1165 'editingteacher' => CAP_ALLOW,
1166 'admin' => CAP_ALLOW
1170 'moodle/block:view' => array(
1171 'captype' => 'read',
1172 'contextlevel' => CONTEXT_BLOCK,
1173 'legacy' => array(
1174 'guest' => CAP_ALLOW,
1175 'user' => CAP_ALLOW,
1176 'student' => CAP_ALLOW,
1177 'teacher' => CAP_ALLOW,
1178 'editingteacher' => CAP_ALLOW,
1179 'coursecreator' => CAP_ALLOW