MDL-11082 Improved groups upgrade performance 1.8x -> 1.9; thanks Eloy for telling...
[moodle-pu.git] / lib / db / access.php
blobbd22cdf7edc40ed08b99929f11b766ba532eb972
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:approvecourse' => array(
126 'riskbitmask' => RISK_XSS,
128 'captype' => 'write',
129 'contextlevel' => CONTEXT_SYSTEM,
130 'legacy' => array(
131 'admin' => CAP_ALLOW
135 'moodle/site:import' => array(
137 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
139 'captype' => 'write',
140 'contextlevel' => CONTEXT_SYSTEM,
141 'legacy' => array(
142 'editingteacher' => CAP_ALLOW,
143 'admin' => CAP_ALLOW
147 'moodle/site:backup' => 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:restore' => 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:manageblocks' => array(
173 'riskbitmask' => RISK_SPAM | RISK_XSS,
175 'captype' => 'write',
176 'contextlevel' => CONTEXT_SYSTEM,
177 'legacy' => array(
178 'editingteacher' => CAP_ALLOW,
179 'admin' => CAP_ALLOW
183 'moodle/site:accessallgroups' => array(
185 'captype' => 'read',
186 'contextlevel' => CONTEXT_SYSTEM,
187 'legacy' => array(
188 'teacher' => CAP_ALLOW,
189 'editingteacher' => CAP_ALLOW,
190 'admin' => CAP_ALLOW
194 'moodle/site:viewfullnames' => array(
196 'captype' => 'read',
197 'contextlevel' => CONTEXT_SYSTEM,
198 'legacy' => array(
199 'teacher' => CAP_ALLOW,
200 'editingteacher' => CAP_ALLOW,
201 'admin' => CAP_ALLOW
205 'moodle/site:viewreports' => array(
207 'riskbitmask' => RISK_PERSONAL,
209 'captype' => 'read',
210 'contextlevel' => CONTEXT_SYSTEM,
211 'legacy' => array(
212 'teacher' => CAP_ALLOW,
213 'editingteacher' => CAP_ALLOW,
214 'admin' => CAP_ALLOW
218 'moodle/site:trustcontent' => array(
220 'riskbitmask' => RISK_XSS,
222 'captype' => 'write',
223 'contextlevel' => CONTEXT_SYSTEM,
224 'legacy' => array(
225 'editingteacher' => CAP_ALLOW,
226 'admin' => CAP_ALLOW
230 'moodle/site:uploadusers' => array(
232 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
234 'captype' => 'write',
235 'contextlevel' => CONTEXT_SYSTEM,
236 'legacy' => array(
237 'admin' => CAP_ALLOW
241 'moodle/site:langeditmaster' => array(
243 'riskbitmask' => RISK_CONFIG | RISK_XSS,
245 'captype' => 'write',
246 'contextlevel' => CONTEXT_SYSTEM,
247 'legacy' => array(
248 'admin' => CAP_PREVENT
252 'moodle/site:langeditlocal' => array(
254 'riskbitmask' => RISK_CONFIG | RISK_XSS,
256 'captype' => 'write',
257 'contextlevel' => CONTEXT_SYSTEM,
258 'legacy' => array(
259 'admin' => CAP_ALLOW
264 'moodle/user:create' => array(
266 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
268 'captype' => 'write',
269 'contextlevel' => CONTEXT_SYSTEM,
270 'legacy' => array(
271 'admin' => CAP_ALLOW
275 'moodle/user:delete' => array(
277 'riskbitmask' => RISK_PERSONAL,
279 'captype' => 'write',
280 'contextlevel' => CONTEXT_SYSTEM,
281 'legacy' => array(
282 'admin' => CAP_ALLOW
286 'moodle/user:update' => array(
288 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
290 'captype' => 'write',
291 'contextlevel' => CONTEXT_SYSTEM,
292 'legacy' => array(
293 'admin' => CAP_ALLOW
297 'moodle/user:viewdetails' => array(
299 'captype' => 'read',
300 'contextlevel' => CONTEXT_SYSTEM,
301 'legacy' => array(
302 'guest' => CAP_ALLOW,
303 'student' => CAP_ALLOW,
304 'teacher' => CAP_ALLOW,
305 'editingteacher' => CAP_ALLOW,
306 'admin' => CAP_ALLOW
310 'moodle/user:viewhiddendetails' => array(
312 'riskbitmask' => RISK_PERSONAL,
314 'captype' => 'read',
315 'contextlevel' => CONTEXT_SYSTEM,
316 'legacy' => array(
317 'teacher' => CAP_ALLOW,
318 'editingteacher' => CAP_ALLOW,
319 'admin' => CAP_ALLOW
323 'moodle/user:loginas' => array(
325 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
327 'captype' => 'write',
328 'contextlevel' => CONTEXT_COURSE,
329 'legacy' => array(
330 'admin' => CAP_ALLOW
334 'moodle/role:assign' => array(
336 'captype' => 'write',
337 'contextlevel' => CONTEXT_SYSTEM,
338 'legacy' => array(
339 'editingteacher' => CAP_ALLOW,
340 'admin' => CAP_ALLOW
344 'moodle/role:override' => array(
346 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
348 'captype' => 'write',
349 'contextlevel' => CONTEXT_SYSTEM,
350 'legacy' => array(
351 'admin' => CAP_ALLOW
355 'moodle/role:manage' => array(
357 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
359 'captype' => 'write',
360 'contextlevel' => CONTEXT_SYSTEM,
361 'legacy' => array(
362 'admin' => CAP_ALLOW
366 'moodle/role:unassignself' => array(
368 'captype' => 'write',
369 'contextlevel' => CONTEXT_SYSTEM,
370 'legacy' => array(
371 'student' => (empty($CFG->allowunenrol)) ? CAP_INHERIT : CAP_ALLOW,
372 'teacher' => CAP_ALLOW,
373 'editingteacher' => CAP_ALLOW,
374 'coursecreator' => CAP_ALLOW,
375 'admin' => CAP_ALLOW
379 'moodle/role:viewhiddenassigns' => array(
381 'captype' => 'read',
382 'contextlevel' => CONTEXT_SYSTEM,
383 'legacy' => array(
384 'teacher' => CAP_ALLOW,
385 'editingteacher' => CAP_ALLOW,
386 'admin' => CAP_ALLOW
390 'moodle/role:switchroles' => array(
392 'riskbitmask' => RISK_XSS,
394 'captype' => 'read',
395 'contextlevel' => CONTEXT_SYSTEM,
396 'legacy' => array(
397 'editingteacher' => CAP_ALLOW,
398 'admin' => CAP_ALLOW
402 'moodle/category:create' => array(
404 'riskbitmask' => RISK_XSS,
406 'captype' => 'write',
407 'contextlevel' => CONTEXT_COURSECAT,
408 'legacy' => array(
409 'admin' => CAP_ALLOW
413 'moodle/category:delete' => array(
415 'captype' => 'write',
416 'contextlevel' => CONTEXT_COURSECAT,
417 'legacy' => array(
418 'admin' => CAP_ALLOW
422 'moodle/category:update' => array(
424 'riskbitmask' => RISK_XSS,
426 'captype' => 'write',
427 'contextlevel' => CONTEXT_COURSECAT,
428 'legacy' => array(
429 'admin' => CAP_ALLOW
433 'moodle/category:visibility' => array(
435 'captype' => 'write',
436 'contextlevel' => CONTEXT_COURSECAT,
437 'legacy' => array(
438 'admin' => CAP_ALLOW
442 'moodle/course:create' => array(
444 'riskbitmask' => RISK_XSS,
446 'captype' => 'write',
447 'contextlevel' => CONTEXT_COURSECAT,
448 'legacy' => array(
449 'coursecreator' => CAP_ALLOW,
450 'admin' => CAP_ALLOW
454 'moodle/course:delete' => array(
456 'captype' => 'write',
457 'contextlevel' => CONTEXT_COURSE,
458 'legacy' => array(
459 'admin' => CAP_ALLOW
463 'moodle/course:update' => array(
465 'riskbitmask' => RISK_XSS,
467 'captype' => 'write',
468 'contextlevel' => CONTEXT_COURSE,
469 'legacy' => array(
470 'editingteacher' => CAP_ALLOW,
471 'admin' => CAP_ALLOW
475 'moodle/course:view' => array(
477 'captype' => 'read',
478 'contextlevel' => CONTEXT_COURSE,
479 'legacy' => array(
480 'guest' => CAP_ALLOW,
481 'student' => CAP_ALLOW,
482 'teacher' => CAP_ALLOW,
483 'editingteacher' => CAP_ALLOW
487 'moodle/course:bulkmessaging' => array(
489 'riskbitmask' => RISK_SPAM,
491 'captype' => 'write',
492 'contextlevel' => CONTEXT_COURSE,
493 'legacy' => array(
494 'teacher' => CAP_ALLOW,
495 'editingteacher' => CAP_ALLOW,
496 'admin' => CAP_ALLOW
500 'moodle/course:viewhiddenuserfields' => array(
502 'riskbitmask' => RISK_PERSONAL,
504 'captype' => 'read',
505 'contextlevel' => CONTEXT_COURSE,
506 'legacy' => array(
507 'teacher' => CAP_ALLOW,
508 'editingteacher' => CAP_ALLOW,
509 'admin' => CAP_ALLOW
513 'moodle/course:viewhiddencourses' => array(
515 'captype' => 'read',
516 'contextlevel' => CONTEXT_COURSE,
517 'legacy' => array(
518 'coursecreator' => CAP_ALLOW,
519 'teacher' => CAP_ALLOW,
520 'editingteacher' => CAP_ALLOW,
521 'admin' => CAP_ALLOW
525 'moodle/course:visibility' => array(
527 'captype' => 'write',
528 'contextlevel' => CONTEXT_COURSE,
529 'legacy' => array(
530 'admin' => CAP_ALLOW
534 'moodle/course:managefiles' => array(
536 'riskbitmask' => RISK_XSS,
538 'captype' => 'write',
539 'contextlevel' => CONTEXT_COURSE,
540 'legacy' => array(
541 'editingteacher' => CAP_ALLOW,
542 'admin' => CAP_ALLOW
546 'moodle/course:manageactivities' => 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:managemetacourse' => array(
560 'captype' => 'write',
561 'contextlevel' => CONTEXT_COURSE,
562 'legacy' => array(
563 'editingteacher' => CAP_ALLOW,
564 'admin' => CAP_ALLOW
568 'moodle/course:activityvisibility' => array(
570 'captype' => 'write',
571 'contextlevel' => CONTEXT_COURSE,
572 'legacy' => array(
573 'editingteacher' => CAP_ALLOW,
574 'admin' => CAP_ALLOW
578 'moodle/course:viewhiddenactivities' => array(
580 'captype' => 'write',
581 'contextlevel' => CONTEXT_COURSE,
582 'legacy' => array(
583 'teacher' => CAP_ALLOW,
584 'editingteacher' => CAP_ALLOW,
585 'admin' => CAP_ALLOW
589 'moodle/course:viewparticipants' => array(
591 'captype' => 'read',
592 'contextlevel' => CONTEXT_COURSE,
593 'legacy' => array(
594 'student' => CAP_ALLOW,
595 'teacher' => CAP_ALLOW,
596 'editingteacher' => CAP_ALLOW,
597 'admin' => CAP_ALLOW
601 'moodle/course:viewscales' => 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/course:managescales' => array(
615 'captype' => 'write',
616 'contextlevel' => CONTEXT_COURSE,
617 'legacy' => array(
618 'editingteacher' => CAP_ALLOW,
619 'admin' => CAP_ALLOW
623 'moodle/course:managegroups' => array(
625 'captype' => 'write',
626 'contextlevel' => CONTEXT_COURSE,
627 'legacy' => array(
628 'editingteacher' => CAP_ALLOW,
629 'admin' => CAP_ALLOW
633 'moodle/course:reset' => array(
635 'captype' => 'write',
636 'contextlevel' => CONTEXT_COURSE,
637 'legacy' => array(
638 'editingteacher' => CAP_ALLOW,
639 'admin' => CAP_ALLOW
643 'moodle/blog:view' => array(
645 'captype' => 'read',
646 'contextlevel' => CONTEXT_SYSTEM,
647 'legacy' => array(
648 'guest' => CAP_ALLOW,
649 'user' => CAP_ALLOW,
650 'student' => CAP_ALLOW,
651 'teacher' => CAP_ALLOW,
652 'editingteacher' => CAP_ALLOW,
653 'admin' => CAP_ALLOW
657 'moodle/blog:create' => array( // works in CONTEXT_SYSTEM only
659 'riskbitmask' => RISK_SPAM,
661 'captype' => 'write',
662 'contextlevel' => CONTEXT_SYSTEM,
663 'legacy' => array(
664 'user' => CAP_ALLOW,
665 'admin' => CAP_ALLOW
669 'moodle/blog:manageofficialtags' => array(
671 'riskbitmask' => RISK_SPAM,
673 'captype' => 'write',
674 'contextlevel' => CONTEXT_SYSTEM,
675 'legacy' => array(
676 'admin' => CAP_ALLOW
680 'moodle/blog:managepersonaltags' => array(
682 'riskbitmask' => RISK_SPAM,
684 'captype' => 'write',
685 'contextlevel' => CONTEXT_SYSTEM,
686 'legacy' => array(
687 'student' => CAP_ALLOW,
688 'teacher' => CAP_ALLOW,
689 'editingteacher' => CAP_ALLOW,
690 'admin' => CAP_ALLOW
694 'moodle/blog:manageentries' => array(
696 'riskbitmask' => RISK_SPAM,
698 'captype' => 'write',
699 'contextlevel' => CONTEXT_SYSTEM,
700 'legacy' => array(
701 'teacher' => CAP_ALLOW,
702 'editingteacher' => CAP_ALLOW,
703 'admin' => CAP_ALLOW
707 'moodle/calendar:manageownentries' => array( // works in CONTEXT_SYSTEM only
709 'riskbitmask' => RISK_SPAM,
711 'captype' => 'write',
712 'contextlevel' => CONTEXT_SYSTEM,
713 'legacy' => array(
714 'user' => CAP_ALLOW,
715 'admin' => CAP_ALLOW
719 'moodle/calendar:manageentries' => array(
721 'riskbitmask' => RISK_SPAM,
723 'captype' => 'write',
724 'contextlevel' => CONTEXT_SYSTEM,
725 'legacy' => array(
726 'teacher' => CAP_ALLOW,
727 'editingteacher' => CAP_ALLOW,
728 'admin' => CAP_ALLOW
732 'moodle/user:editprofile' => array(
734 'riskbitmask' => RISK_SPAM,
736 'captype' => 'write',
737 'contextlevel' => CONTEXT_USER,
738 'legacy' => array(
739 'admin' => CAP_ALLOW
743 'moodle/user:editownprofile' => array(
745 'captype' => 'write',
746 'contextlevel' => CONTEXT_SYSTEM,
747 'legacy' => array(
748 'guest' => CAP_PROHIBIT,
749 'user' => CAP_ALLOW,
750 'admin' => CAP_ALLOW
754 'moodle/user:changeownpassword' => array(
756 'captype' => 'write',
757 'contextlevel' => CONTEXT_SYSTEM,
758 'legacy' => array(
759 'guest' => CAP_PROHIBIT,
760 'user' => CAP_ALLOW,
761 'admin' => CAP_ALLOW
765 // The next 3 might make no sense for some roles, e.g teacher, etc.
766 // since the next level up is site. These are more for the parent role
767 'moodle/user:readuserposts' => array(
769 'captype' => 'read',
770 'contextlevel' => CONTEXT_USER,
771 'legacy' => array(
772 'student' => CAP_ALLOW,
773 'teacher' => CAP_ALLOW,
774 'editingteacher' => CAP_ALLOW,
775 'admin' => CAP_ALLOW
779 'moodle/user:readuserblogs' => array(
781 'captype' => 'read',
782 'contextlevel' => CONTEXT_USER,
783 'legacy' => array(
784 'student' => CAP_ALLOW,
785 'teacher' => CAP_ALLOW,
786 'editingteacher' => CAP_ALLOW,
787 'admin' => CAP_ALLOW
791 'moodle/user:viewuseractivitiesreport' => array(
793 'captype' => 'read',
794 'contextlevel' => CONTEXT_USER,
795 'legacy' => array(
796 'teacher' => CAP_ALLOW,
797 'editingteacher' => CAP_ALLOW,
798 'admin' => CAP_ALLOW
802 'moodle/question:managecategory' => array(
804 'captype' => 'write',
805 'contextlevel' => CONTEXT_COURSE,
806 'legacy' => array(
807 'editingteacher' => CAP_ALLOW,
808 'admin' => CAP_ALLOW
812 //new in moodle 1.9
813 'moodle/question:add' => array(
814 'riskbitmask' => RISK_SPAM,
815 'captype' => 'write',
816 'contextlevel' => CONTEXT_COURSE,
817 'legacy' => array(
818 'editingteacher' => CAP_ALLOW,
819 'admin' => CAP_ALLOW
821 'clonepermissionsfrom' => 'moodle/question:manage'
823 'moodle/question:editmine' => array(
824 'riskbitmask' => RISK_SPAM,
825 'captype' => 'write',
826 'contextlevel' => CONTEXT_COURSE,
827 'legacy' => array(
828 'editingteacher' => CAP_ALLOW,
829 'admin' => CAP_ALLOW
831 'clonepermissionsfrom' => 'moodle/question:manage'
833 'moodle/question:editall' => array(
834 'riskbitmask' => RISK_SPAM,
835 'captype' => 'write',
836 'contextlevel' => CONTEXT_COURSE,
837 'legacy' => array(
838 'editingteacher' => CAP_ALLOW,
839 'admin' => CAP_ALLOW
841 'clonepermissionsfrom' => 'moodle/question:manage'
843 'moodle/question:viewmine' => array(
844 'captype' => 'read',
845 'contextlevel' => CONTEXT_COURSE,
846 'legacy' => array(
847 'editingteacher' => CAP_ALLOW,
848 'admin' => CAP_ALLOW
850 'clonepermissionsfrom' => 'moodle/question:manage'
852 'moodle/question:viewall' => 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:usemine' => 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:useall' => 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:movemine' => array(
880 'captype' => 'write',
881 'contextlevel' => CONTEXT_COURSE,
882 'legacy' => array(
883 'editingteacher' => CAP_ALLOW,
884 'admin' => CAP_ALLOW
886 'clonepermissionsfrom' => 'moodle/question:manage'
888 'moodle/question:moveall' => 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 //END new in moodle 1.9
899 // Configure the installed question types.
900 'moodle/question:config' => array(
902 'riskbitmask' => RISK_CONFIG,
904 'captype' => 'write',
905 'contextlevel' => CONTEXT_SYSTEM,
906 'legacy' => array(
907 'admin' => CAP_ALLOW
911 'moodle/site:doclinks' => array(
913 'captype' => 'read',
914 'contextlevel' => CONTEXT_SYSTEM,
915 'legacy' => array(
916 'teacher' => CAP_ALLOW,
917 'editingteacher' => CAP_ALLOW,
918 'admin' => CAP_ALLOW
922 'moodle/course:sectionvisibility' => array(
924 'captype' => 'write',
925 'contextlevel' => CONTEXT_COURSE,
926 'legacy' => array(
927 'editingteacher' => CAP_ALLOW,
928 'admin' => CAP_ALLOW
932 'moodle/course:useremail' => array(
934 'captype' => 'write',
935 'contextlevel' => CONTEXT_COURSE,
936 'legacy' => array(
937 'editingteacher' => CAP_ALLOW,
938 'admin' => CAP_ALLOW
942 'moodle/course:viewhiddensections' => array(
944 'captype' => 'write',
945 'contextlevel' => CONTEXT_COURSE,
946 'legacy' => array(
947 'editingteacher' => CAP_ALLOW,
948 'admin' => CAP_ALLOW
952 'moodle/course:setcurrentsection' => array(
954 'captype' => 'write',
955 'contextlevel' => CONTEXT_COURSE,
956 'legacy' => array(
957 'editingteacher' => CAP_ALLOW,
958 'admin' => CAP_ALLOW
962 'moodle/site:mnetlogintoremote' => array(
963 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
964 'captype' => 'read',
965 'contextlevel' => CONTEXT_SYSTEM,
966 'legacy' => array(
967 'admin' => CAP_ALLOW
971 'moodle/grade:viewall' => array(
972 'riskbitmask' => RISK_PERSONAL,
973 'captype' => 'read',
974 'contextlevel' => CONTEXT_COURSE,
975 'legacy' => array(
976 'teacher' => CAP_ALLOW,
977 'editingteacher' => CAP_ALLOW,
978 'admin' => CAP_ALLOW
980 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
983 'moodle/grade:view' => array(
984 'captype' => 'read',
985 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_PERSONAL too
986 'legacy' => array(
987 'student' => CAP_ALLOW
991 'moodle/grade:viewhidden' => array(
992 'riskbitmask' => RISK_PERSONAL,
993 'captype' => 'read',
994 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_PERSONAL too
995 'legacy' => array(
997 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
1000 'moodle/grade:import' => array(
1001 'riskbitmask' => RISK_PERSONAL,
1002 'captype' => 'write',
1003 'contextlevel' => CONTEXT_COURSE,
1004 'legacy' => array(
1005 'editingteacher' => CAP_ALLOW,
1006 'admin' => CAP_ALLOW
1008 'clonepermissionsfrom' => 'moodle/course:managegrades'
1011 'moodle/grade:export' => array(
1012 'riskbitmask' => RISK_PERSONAL,
1013 'captype' => 'read',
1014 'contextlevel' => CONTEXT_COURSE,
1015 'legacy' => array(
1016 'teacher' => CAP_ALLOW,
1017 'editingteacher' => CAP_ALLOW,
1018 'admin' => CAP_ALLOW
1020 'clonepermissionsfrom' => 'moodle/course:managegrades'
1023 'moodle/grade:manage' => array(
1024 'riskbitmask' => RISK_PERSONAL,
1025 'captype' => 'write',
1026 'contextlevel' => CONTEXT_COURSE,
1027 'legacy' => array(
1028 'editingteacher' => CAP_ALLOW,
1029 'admin' => CAP_ALLOW
1031 'clonepermissionsfrom' => 'moodle/course:managegrades'
1034 'moodle/grade:manageoutcomes' => array(
1035 'riskbitmask' => RISK_PERSONAL,
1036 'captype' => 'write',
1037 'contextlevel' => CONTEXT_COURSE,
1038 'legacy' => array(
1039 'editingteacher' => CAP_ALLOW,
1040 'admin' => CAP_ALLOW
1042 'clonepermissionsfrom' => 'moodle/course:managegrades'
1045 'moodle/grade:hide' => array(
1046 'captype' => 'write',
1047 'contextlevel' => CONTEXT_COURSE,
1048 'legacy' => array(
1049 'editingteacher' => CAP_ALLOW,
1050 'admin' => CAP_ALLOW
1054 'moodle/grade:lock' => array(
1055 'captype' => 'write',
1056 'contextlevel' => CONTEXT_COURSE,
1057 'legacy' => array(
1058 'editingteacher' => CAP_ALLOW,
1059 'admin' => CAP_ALLOW
1063 'moodle/grade:unlock' => array(
1064 'captype' => 'write',
1065 'contextlevel' => CONTEXT_COURSE,
1066 'legacy' => array(
1067 'editingteacher' => CAP_ALLOW,
1068 'admin' => CAP_ALLOW
1072 'moodle/grade:override' => array(
1073 'captype' => 'write',
1074 'contextlevel' => CONTEXT_COURSE,
1075 'legacy' => array(
1076 'editingteacher' => CAP_ALLOW,
1077 'admin' => CAP_ALLOW
1081 'moodle/my:manageblocks' => array(
1082 'captype' => 'write',
1083 'contextlevel' => CONTEXT_SYSTEM,
1084 'legacy' => array(
1085 'user' => CAP_ALLOW
1089 'moodle/notes:view' => array(
1090 'captype' => 'read',
1091 'contextlevel' => CONTEXT_SYSTEM,
1092 'legacy' => array(
1093 'teacher' => CAP_ALLOW,
1094 'editingteacher' => CAP_ALLOW,
1095 'admin' => CAP_ALLOW
1099 'moodle/notes:manage' => array(
1100 'captype' => 'write',
1101 'contextlevel' => CONTEXT_SYSTEM,
1102 'legacy' => array(
1103 'teacher' => CAP_ALLOW,
1104 'editingteacher' => CAP_ALLOW,
1105 'admin' => CAP_ALLOW
1109 'moodle/tag:manage' => array(
1110 'captype' => 'write',
1111 'contextlevel' => CONTEXT_SYSTEM,
1112 'legacy' => array(
1113 'teacher' => CAP_ALLOW,
1114 'editingteacher' => CAP_ALLOW,
1115 'admin' => CAP_ALLOW
1119 'moodle/tag:create' => array(
1120 'captype' => 'write',
1121 'contextlevel' => CONTEXT_SYSTEM,
1122 'legacy' => array(
1123 'admin' => CAP_ALLOW,
1124 'user' => CAP_ALLOW
1128 'moodle/tag:edit' => array(
1129 'captype' => 'write',
1130 'contextlevel' => CONTEXT_SYSTEM,
1131 'legacy' => array(
1132 'admin' => CAP_ALLOW,
1133 'user' => CAP_ALLOW
1137 'moodle/tag:editblocks' => array(
1138 'captype' => 'write',
1139 'contextlevel' => CONTEXT_SYSTEM,
1140 'legacy' => array(
1141 'teacher' => CAP_ALLOW,
1142 'editingteacher' => CAP_ALLOW,
1143 'admin' => CAP_ALLOW
1147 'moodle/block:view' => array(
1148 'captype' => 'read',
1149 'contextlevel' => CONTEXT_BLOCK,
1150 'legacy' => array(
1151 'guest' => CAP_ALLOW,
1152 'user' => CAP_ALLOW,
1153 'student' => CAP_ALLOW,
1154 'teacher' => CAP_ALLOW,
1155 'editingteacher' => CAP_ALLOW,
1156 'coursecreator' => CAP_ALLOW