Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / lib / db / access.php
blobc3107f65827d7fc9222a1011491b751aefee7e43
1 <?php // $Id$
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 | RISK_DATALOSS,
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 | RISK_DATALOSS,
96 'captype' => 'legacy',
97 'contextlevel' => CONTEXT_SYSTEM
101 'moodle/site:config' => array(
103 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG | RISK_DATALOSS,
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_SPAM,
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_COURSE,
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_COURSE,
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_COURSE,
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_BLOCK,
189 'legacy' => array(
190 'editingteacher' => CAP_ALLOW,
191 'admin' => CAP_ALLOW
195 'moodle/site:accessallgroups' => array(
197 'captype' => 'read',
198 'contextlevel' => CONTEXT_COURSE,
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_COURSE,
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_COURSE,
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_COURSE,
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, RISK_DATALOSS,
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_COURSE,
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_COURSE,
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 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
350 'captype' => 'write',
351 'contextlevel' => CONTEXT_COURSE,
352 'legacy' => array(
353 'editingteacher' => CAP_ALLOW,
354 'admin' => CAP_ALLOW
358 'moodle/role:override' => array(
360 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
362 'captype' => 'write',
363 'contextlevel' => CONTEXT_COURSE,
364 'legacy' => array(
365 'admin' => CAP_ALLOW
369 'moodle/role:safeoverride' => array(
371 'riskbitmask' => RISK_SPAM,
373 'captype' => 'write',
374 'contextlevel' => CONTEXT_COURSE,
375 'legacy' => array(
376 'editingteacher' => CAP_ALLOW
380 'moodle/role:manage' => array(
382 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
384 'captype' => 'write',
385 'contextlevel' => CONTEXT_SYSTEM,
386 'legacy' => array(
387 'admin' => CAP_ALLOW
391 'moodle/role:unassignself' => array(
393 'captype' => 'write',
394 'contextlevel' => CONTEXT_COURSE,
395 'legacy' => array(
396 'student' => (empty($CFG->allowunenrol)) ? CAP_INHERIT : CAP_ALLOW,
397 'teacher' => CAP_ALLOW,
398 'editingteacher' => CAP_ALLOW,
399 'coursecreator' => CAP_ALLOW,
400 'admin' => CAP_ALLOW
404 'moodle/role:viewhiddenassigns' => array(
406 'captype' => 'read',
407 'contextlevel' => CONTEXT_COURSE,
408 'legacy' => array(
409 'teacher' => CAP_ALLOW,
410 'editingteacher' => CAP_ALLOW,
411 'admin' => CAP_ALLOW
415 'moodle/role:switchroles' => array(
417 'riskbitmask' => RISK_XSS | RISK_PERSONAL,
419 'captype' => 'read',
420 'contextlevel' => CONTEXT_COURSE,
421 'legacy' => array(
422 'editingteacher' => CAP_ALLOW,
423 'admin' => CAP_ALLOW
427 'moodle/category:create' => array(
429 'riskbitmask' => RISK_XSS,
431 'captype' => 'write',
432 'contextlevel' => CONTEXT_COURSECAT,
433 'legacy' => array(
434 'admin' => CAP_ALLOW
438 'moodle/category:delete' => array(
440 'riskbitmask' => RISK_DATALOSS,
442 'captype' => 'write',
443 'contextlevel' => CONTEXT_COURSECAT,
444 'legacy' => array(
445 'admin' => CAP_ALLOW
449 'moodle/category:update' => array(
451 'riskbitmask' => RISK_XSS,
453 'captype' => 'write',
454 'contextlevel' => CONTEXT_COURSECAT,
455 'legacy' => array(
456 'admin' => CAP_ALLOW
460 'moodle/category:visibility' => array(
462 'captype' => 'write',
463 'contextlevel' => CONTEXT_COURSECAT,
464 'legacy' => array(
465 'admin' => CAP_ALLOW
469 'moodle/course:create' => array(
471 'riskbitmask' => RISK_XSS,
473 'captype' => 'write',
474 'contextlevel' => CONTEXT_COURSECAT,
475 'legacy' => array(
476 'coursecreator' => CAP_ALLOW,
477 'admin' => CAP_ALLOW
481 'moodle/course:delete' => array(
483 'riskbitmask' => RISK_DATALOSS,
485 'captype' => 'write',
486 'contextlevel' => CONTEXT_COURSE,
487 'legacy' => array(
488 'admin' => CAP_ALLOW
492 'moodle/course:update' => array(
494 'riskbitmask' => RISK_XSS,
496 'captype' => 'write',
497 'contextlevel' => CONTEXT_COURSE,
498 'legacy' => array(
499 'editingteacher' => CAP_ALLOW,
500 'admin' => CAP_ALLOW
504 'moodle/course:view' => array(
506 'captype' => 'read',
507 'contextlevel' => CONTEXT_COURSE,
508 'legacy' => array(
509 'guest' => CAP_ALLOW,
510 'student' => CAP_ALLOW,
511 'teacher' => CAP_ALLOW,
512 'editingteacher' => CAP_ALLOW
516 'moodle/course:bulkmessaging' => array(
518 'riskbitmask' => RISK_SPAM,
520 'captype' => 'write',
521 'contextlevel' => CONTEXT_COURSE,
522 'legacy' => array(
523 'teacher' => CAP_ALLOW,
524 'editingteacher' => CAP_ALLOW,
525 'admin' => CAP_ALLOW
529 'moodle/course:viewhiddenuserfields' => array(
531 'riskbitmask' => RISK_PERSONAL,
533 'captype' => 'read',
534 'contextlevel' => CONTEXT_COURSE,
535 'legacy' => array(
536 'teacher' => CAP_ALLOW,
537 'editingteacher' => CAP_ALLOW,
538 'admin' => CAP_ALLOW
542 'moodle/course:viewhiddencourses' => array(
544 'captype' => 'read',
545 'contextlevel' => CONTEXT_COURSE,
546 'legacy' => array(
547 'coursecreator' => CAP_ALLOW,
548 'teacher' => CAP_ALLOW,
549 'editingteacher' => CAP_ALLOW,
550 'admin' => CAP_ALLOW
554 'moodle/course:visibility' => array(
556 'captype' => 'write',
557 'contextlevel' => CONTEXT_COURSE,
558 'legacy' => array(
559 'admin' => CAP_ALLOW
563 'moodle/course:managefiles' => array(
565 'riskbitmask' => RISK_XSS,
567 'captype' => 'write',
568 'contextlevel' => CONTEXT_COURSE,
569 'legacy' => array(
570 'editingteacher' => CAP_ALLOW,
571 'admin' => CAP_ALLOW
575 'moodle/course:manageactivities' => array(
577 'riskbitmask' => RISK_XSS,
579 'captype' => 'write',
580 'contextlevel' => CONTEXT_COURSE,
581 'legacy' => array(
582 'editingteacher' => CAP_ALLOW,
583 'admin' => CAP_ALLOW
587 'moodle/course:managemetacourse' => array(
589 'riskbitmask' => RISK_XSS | RISK_PERSONAL,
591 'captype' => 'write',
592 'contextlevel' => CONTEXT_COURSE,
593 'legacy' => array(
594 'editingteacher' => CAP_ALLOW,
595 'admin' => CAP_ALLOW
599 'moodle/course:activityvisibility' => array(
601 'captype' => 'write',
602 'contextlevel' => CONTEXT_COURSE,
603 'legacy' => array(
604 'editingteacher' => CAP_ALLOW,
605 'admin' => CAP_ALLOW
609 'moodle/course:viewhiddenactivities' => array(
611 'captype' => 'write',
612 'contextlevel' => CONTEXT_COURSE,
613 'legacy' => array(
614 'teacher' => CAP_ALLOW,
615 'editingteacher' => CAP_ALLOW,
616 'admin' => CAP_ALLOW
620 'moodle/course:viewparticipants' => array(
622 'captype' => 'read',
623 'contextlevel' => CONTEXT_COURSE,
624 'legacy' => array(
625 'student' => CAP_ALLOW,
626 'teacher' => CAP_ALLOW,
627 'editingteacher' => CAP_ALLOW,
628 'admin' => CAP_ALLOW
632 'moodle/site:viewparticipants' => array(
634 'captype' => 'read',
635 'contextlevel' => CONTEXT_SYSTEM,
636 'legacy' => array(
637 'admin' => CAP_ALLOW
641 'moodle/course:viewscales' => array(
643 'captype' => 'read',
644 'contextlevel' => CONTEXT_COURSE,
645 'legacy' => array(
646 'student' => CAP_ALLOW,
647 'teacher' => CAP_ALLOW,
648 'editingteacher' => CAP_ALLOW,
649 'admin' => CAP_ALLOW
653 'moodle/course:managescales' => array(
655 'captype' => 'write',
656 'contextlevel' => CONTEXT_COURSE,
657 'legacy' => array(
658 'editingteacher' => CAP_ALLOW,
659 'admin' => CAP_ALLOW
663 'moodle/course:managegroups' => array(
665 'captype' => 'write',
666 'contextlevel' => CONTEXT_COURSE,
667 'legacy' => array(
668 'editingteacher' => CAP_ALLOW,
669 'admin' => CAP_ALLOW
673 'moodle/course:reset' => array(
675 'riskbitmask' => RISK_DATALOSS,
677 'captype' => 'write',
678 'contextlevel' => CONTEXT_COURSE,
679 'legacy' => array(
680 'editingteacher' => CAP_ALLOW,
681 'admin' => CAP_ALLOW
685 'moodle/blog:view' => array(
687 'captype' => 'read',
688 'contextlevel' => CONTEXT_COURSE,
689 'legacy' => array(
690 'guest' => CAP_ALLOW,
691 'user' => CAP_ALLOW,
692 'student' => CAP_ALLOW,
693 'teacher' => CAP_ALLOW,
694 'editingteacher' => CAP_ALLOW,
695 'admin' => CAP_ALLOW
699 'moodle/blog:create' => array( // works in CONTEXT_SYSTEM only
701 'riskbitmask' => RISK_SPAM,
703 'captype' => 'write',
704 'contextlevel' => CONTEXT_SYSTEM,
705 'legacy' => array(
706 'user' => CAP_ALLOW,
707 'admin' => CAP_ALLOW
711 'moodle/blog:manageentries' => array(
713 'riskbitmask' => RISK_SPAM,
715 'captype' => 'write',
716 'contextlevel' => CONTEXT_COURSE,
717 'legacy' => array(
718 'teacher' => CAP_ALLOW,
719 'editingteacher' => CAP_ALLOW,
720 'admin' => CAP_ALLOW
724 'moodle/calendar:manageownentries' => array( // works in CONTEXT_SYSTEM only
726 'riskbitmask' => RISK_SPAM,
728 'captype' => 'write',
729 'contextlevel' => CONTEXT_COURSE,
730 'legacy' => array(
731 'user' => CAP_ALLOW,
732 'admin' => CAP_ALLOW
736 'moodle/calendar:managegroupentries' => array(
738 'riskbitmask' => RISK_SPAM,
740 'captype' => 'write',
741 'contextlevel' => CONTEXT_COURSE,
742 'legacy' => array(
743 'teacher' => CAP_ALLOW,
744 'editingteacher' => CAP_ALLOW,
745 'admin' => CAP_ALLOW
749 'moodle/calendar:manageentries' => array(
751 'riskbitmask' => RISK_SPAM,
753 'captype' => 'write',
754 'contextlevel' => CONTEXT_COURSE,
755 'legacy' => array(
756 'teacher' => CAP_ALLOW,
757 'editingteacher' => CAP_ALLOW,
758 'admin' => CAP_ALLOW
762 'moodle/user:editprofile' => array(
764 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
766 'captype' => 'write',
767 'contextlevel' => CONTEXT_USER,
768 'legacy' => array(
769 'admin' => CAP_ALLOW
773 'moodle/user:editownprofile' => array(
775 'riskbitmask' => RISK_SPAM,
777 'captype' => 'write',
778 'contextlevel' => CONTEXT_SYSTEM,
779 'legacy' => array(
780 'guest' => CAP_PROHIBIT,
781 'user' => CAP_ALLOW,
782 'admin' => CAP_ALLOW
786 'moodle/user:changeownpassword' => array(
788 'captype' => 'write',
789 'contextlevel' => CONTEXT_SYSTEM,
790 'legacy' => array(
791 'guest' => CAP_PROHIBIT,
792 'user' => CAP_ALLOW,
793 'admin' => CAP_ALLOW
797 // The next 3 might make no sense for some roles, e.g teacher, etc.
798 // since the next level up is site. These are more for the parent role
799 'moodle/user:readuserposts' => array(
801 'captype' => 'read',
802 'contextlevel' => CONTEXT_USER,
803 'legacy' => array(
804 'student' => CAP_ALLOW,
805 'teacher' => CAP_ALLOW,
806 'editingteacher' => CAP_ALLOW,
807 'admin' => CAP_ALLOW
811 'moodle/user:readuserblogs' => array(
813 'captype' => 'read',
814 'contextlevel' => CONTEXT_USER,
815 'legacy' => array(
816 'student' => CAP_ALLOW,
817 'teacher' => CAP_ALLOW,
818 'editingteacher' => CAP_ALLOW,
819 'admin' => CAP_ALLOW
823 'moodle/user:viewuseractivitiesreport' => array(
825 'captype' => 'read',
826 'contextlevel' => CONTEXT_USER,
827 'legacy' => array(
828 'teacher' => CAP_ALLOW,
829 'editingteacher' => CAP_ALLOW,
830 'admin' => CAP_ALLOW
834 'moodle/question:managecategory' => array(
835 'riskbitmask' => RISK_SPAM | RISK_XSS,
836 'captype' => 'write',
837 'contextlevel' => CONTEXT_COURSE,
838 'legacy' => array(
839 'editingteacher' => CAP_ALLOW,
840 'admin' => CAP_ALLOW
844 //new in moodle 1.9
845 'moodle/question:add' => array(
846 'riskbitmask' => RISK_SPAM | RISK_XSS,
847 'captype' => 'write',
848 'contextlevel' => CONTEXT_COURSE,
849 'legacy' => array(
850 'editingteacher' => CAP_ALLOW,
851 'admin' => CAP_ALLOW
853 'clonepermissionsfrom' => 'moodle/question:manage'
855 'moodle/question:editmine' => array(
856 'riskbitmask' => RISK_SPAM | RISK_XSS,
857 'captype' => 'write',
858 'contextlevel' => CONTEXT_COURSE,
859 'legacy' => array(
860 'editingteacher' => CAP_ALLOW,
861 'admin' => CAP_ALLOW
863 'clonepermissionsfrom' => 'moodle/question:manage'
865 'moodle/question:editall' => array(
866 'riskbitmask' => RISK_SPAM | RISK_XSS,
867 'captype' => 'write',
868 'contextlevel' => CONTEXT_COURSE,
869 'legacy' => array(
870 'editingteacher' => CAP_ALLOW,
871 'admin' => CAP_ALLOW
873 'clonepermissionsfrom' => 'moodle/question:manage'
875 'moodle/question:viewmine' => array(
876 'captype' => 'read',
877 'contextlevel' => CONTEXT_COURSE,
878 'legacy' => array(
879 'editingteacher' => CAP_ALLOW,
880 'admin' => CAP_ALLOW
882 'clonepermissionsfrom' => 'moodle/question:manage'
884 'moodle/question:viewall' => array(
885 'captype' => 'read',
886 'contextlevel' => CONTEXT_COURSE,
887 'legacy' => array(
888 'editingteacher' => CAP_ALLOW,
889 'admin' => CAP_ALLOW
891 'clonepermissionsfrom' => 'moodle/question:manage'
893 'moodle/question:usemine' => array(
894 'captype' => 'read',
895 'contextlevel' => CONTEXT_COURSE,
896 'legacy' => array(
897 'editingteacher' => CAP_ALLOW,
898 'admin' => CAP_ALLOW
900 'clonepermissionsfrom' => 'moodle/question:manage'
902 'moodle/question:useall' => array(
903 'captype' => 'read',
904 'contextlevel' => CONTEXT_COURSE,
905 'legacy' => array(
906 'editingteacher' => CAP_ALLOW,
907 'admin' => CAP_ALLOW
909 'clonepermissionsfrom' => 'moodle/question:manage'
911 'moodle/question:movemine' => array(
912 'captype' => 'write',
913 'contextlevel' => CONTEXT_COURSE,
914 'legacy' => array(
915 'editingteacher' => CAP_ALLOW,
916 'admin' => CAP_ALLOW
918 'clonepermissionsfrom' => 'moodle/question:manage'
920 'moodle/question:moveall' => array(
921 'captype' => 'write',
922 'contextlevel' => CONTEXT_COURSE,
923 'legacy' => array(
924 'editingteacher' => CAP_ALLOW,
925 'admin' => CAP_ALLOW
927 'clonepermissionsfrom' => 'moodle/question:manage'
929 //END new in moodle 1.9
931 // Configure the installed question types.
932 'moodle/question:config' => array(
933 'riskbitmask' => RISK_CONFIG,
934 'captype' => 'write',
935 'contextlevel' => CONTEXT_SYSTEM,
936 'legacy' => array(
937 'admin' => CAP_ALLOW
941 'moodle/site:doclinks' => array(
943 'captype' => 'read',
944 'contextlevel' => CONTEXT_SYSTEM,
945 'legacy' => array(
946 'teacher' => CAP_ALLOW,
947 'editingteacher' => CAP_ALLOW,
948 'admin' => CAP_ALLOW
952 'moodle/course:sectionvisibility' => array(
954 'captype' => 'write',
955 'contextlevel' => CONTEXT_COURSE,
956 'legacy' => array(
957 'editingteacher' => CAP_ALLOW,
958 'admin' => CAP_ALLOW
962 'moodle/course:useremail' => array(
964 'captype' => 'write',
965 'contextlevel' => CONTEXT_COURSE,
966 'legacy' => array(
967 'editingteacher' => CAP_ALLOW,
968 'admin' => CAP_ALLOW
972 'moodle/course:viewhiddensections' => array(
974 'captype' => 'write',
975 'contextlevel' => CONTEXT_COURSE,
976 'legacy' => array(
977 'editingteacher' => CAP_ALLOW,
978 'admin' => CAP_ALLOW
982 'moodle/course:setcurrentsection' => array(
984 'captype' => 'write',
985 'contextlevel' => CONTEXT_COURSE,
986 'legacy' => array(
987 'editingteacher' => CAP_ALLOW,
988 'admin' => CAP_ALLOW
992 'moodle/site:mnetlogintoremote' => array(
993 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
994 'captype' => 'read',
995 'contextlevel' => CONTEXT_SYSTEM,
996 'legacy' => array(
997 'admin' => CAP_ALLOW
1001 'moodle/grade:viewall' => array(
1002 'riskbitmask' => RISK_PERSONAL,
1003 'captype' => 'read',
1004 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_USER
1005 'legacy' => array(
1006 'teacher' => CAP_ALLOW,
1007 'editingteacher' => CAP_ALLOW,
1008 'admin' => CAP_ALLOW
1010 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
1013 'moodle/grade:view' => array(
1014 'captype' => 'read',
1015 'contextlevel' => CONTEXT_COURSE,
1016 'legacy' => array(
1017 'student' => CAP_ALLOW
1021 'moodle/grade:viewhidden' => array(
1022 'riskbitmask' => RISK_PERSONAL,
1023 'captype' => 'read',
1024 'contextlevel' => CONTEXT_COURSE,
1025 'legacy' => array(
1026 'teacher' => CAP_ALLOW,
1027 'editingteacher' => CAP_ALLOW,
1028 'admin' => CAP_ALLOW
1030 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
1033 'moodle/grade:import' => array(
1034 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
1035 'captype' => 'write',
1036 'contextlevel' => CONTEXT_COURSE,
1037 'legacy' => array(
1038 'editingteacher' => CAP_ALLOW,
1039 'admin' => CAP_ALLOW
1041 'clonepermissionsfrom' => 'moodle/course:managegrades'
1044 'moodle/grade:export' => array(
1045 'riskbitmask' => RISK_PERSONAL,
1046 'captype' => 'read',
1047 'contextlevel' => CONTEXT_COURSE,
1048 'legacy' => array(
1049 'teacher' => CAP_ALLOW,
1050 'editingteacher' => CAP_ALLOW,
1051 'admin' => CAP_ALLOW
1053 'clonepermissionsfrom' => 'moodle/course:managegrades'
1056 'moodle/grade:manage' => array(
1057 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
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:edit' => array(
1068 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
1069 'captype' => 'write',
1070 'contextlevel' => CONTEXT_COURSE,
1071 'legacy' => array(
1072 'editingteacher' => CAP_ALLOW,
1073 'admin' => CAP_ALLOW
1075 'clonepermissionsfrom' => 'moodle/course:managegrades'
1078 'moodle/grade:manageoutcomes' => array(
1079 'captype' => 'write',
1080 'contextlevel' => CONTEXT_COURSE,
1081 'legacy' => array(
1082 'editingteacher' => CAP_ALLOW,
1083 'admin' => CAP_ALLOW
1085 'clonepermissionsfrom' => 'moodle/course:managegrades'
1088 'moodle/grade:manageletters' => array(
1089 'captype' => 'write',
1090 'contextlevel' => CONTEXT_COURSE,
1091 'legacy' => array(
1092 'editingteacher' => CAP_ALLOW,
1093 'admin' => CAP_ALLOW
1095 'clonepermissionsfrom' => 'moodle/course:managegrades'
1098 'moodle/grade:hide' => array(
1099 'captype' => 'write',
1100 'contextlevel' => CONTEXT_COURSE,
1101 'legacy' => array(
1102 'editingteacher' => CAP_ALLOW,
1103 'admin' => CAP_ALLOW
1107 'moodle/grade:lock' => array(
1108 'captype' => 'write',
1109 'contextlevel' => CONTEXT_COURSE,
1110 'legacy' => array(
1111 'editingteacher' => CAP_ALLOW,
1112 'admin' => CAP_ALLOW
1116 'moodle/grade:unlock' => array(
1117 'captype' => 'write',
1118 'contextlevel' => CONTEXT_COURSE,
1119 'legacy' => array(
1120 'editingteacher' => CAP_ALLOW,
1121 'admin' => CAP_ALLOW
1125 'moodle/my:manageblocks' => array(
1126 'captype' => 'write',
1127 'contextlevel' => CONTEXT_SYSTEM,
1128 'legacy' => array(
1129 'user' => CAP_ALLOW
1133 'moodle/notes:view' => array(
1134 'captype' => 'read',
1135 'contextlevel' => CONTEXT_COURSE,
1136 'legacy' => array(
1137 'teacher' => CAP_ALLOW,
1138 'editingteacher' => CAP_ALLOW,
1139 'admin' => CAP_ALLOW
1143 'moodle/notes:manage' => array(
1144 'riskbitmask' => RISK_SPAM,
1146 'captype' => 'write',
1147 'contextlevel' => CONTEXT_COURSE,
1148 'legacy' => array(
1149 'teacher' => CAP_ALLOW,
1150 'editingteacher' => CAP_ALLOW,
1151 'admin' => CAP_ALLOW
1155 'moodle/tag:manage' => array(
1156 'riskbitmask' => RISK_SPAM,
1158 'captype' => 'write',
1159 'contextlevel' => CONTEXT_SYSTEM,
1160 'legacy' => array(
1161 'teacher' => CAP_ALLOW,
1162 'editingteacher' => CAP_ALLOW,
1163 'admin' => CAP_ALLOW
1167 'moodle/tag:create' => array(
1168 'riskbitmask' => RISK_SPAM,
1170 'captype' => 'write',
1171 'contextlevel' => CONTEXT_SYSTEM,
1172 'legacy' => array(
1173 'admin' => CAP_ALLOW,
1174 'user' => CAP_ALLOW
1178 'moodle/tag:edit' => array(
1179 'riskbitmask' => RISK_SPAM,
1181 'captype' => 'write',
1182 'contextlevel' => CONTEXT_SYSTEM,
1183 'legacy' => array(
1184 'admin' => CAP_ALLOW,
1185 'user' => CAP_ALLOW
1189 'moodle/tag:editblocks' => array(
1190 'captype' => 'write',
1191 'contextlevel' => CONTEXT_SYSTEM,
1192 'legacy' => array(
1193 'teacher' => CAP_ALLOW,
1194 'editingteacher' => CAP_ALLOW,
1195 'admin' => CAP_ALLOW
1199 'moodle/block:view' => array(
1200 'captype' => 'read',
1201 'contextlevel' => CONTEXT_BLOCK,
1202 'legacy' => array(
1203 'guest' => CAP_ALLOW,
1204 'user' => CAP_ALLOW,
1205 'student' => CAP_ALLOW,
1206 'teacher' => CAP_ALLOW,
1207 'editingteacher' => CAP_ALLOW,
1208 'coursecreator' => CAP_ALLOW