3 // Capability definitions for Moodle core.
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.
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]/<plugin_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 is $capabilities
31 $capabilities = array(
32 'moodle/site:config' => array(
34 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG | RISK_DATALOSS,
37 'contextlevel' => CONTEXT_SYSTEM,
42 'moodle/site:readallmessages' => array(
44 'riskbitmask' => RISK_PERSONAL,
47 'contextlevel' => CONTEXT_SYSTEM,
49 'manager' => CAP_ALLOW,
50 'editingteacher' => CAP_ALLOW
54 'moodle/site:sendmessage' => array(
56 'riskbitmask' => RISK_SPAM,
59 'contextlevel' => CONTEXT_SYSTEM,
61 'manager' => CAP_ALLOW,
66 'moodle/site:approvecourse' => array(
68 'riskbitmask' => RISK_XSS,
71 'contextlevel' => CONTEXT_SYSTEM,
73 'manager' => CAP_ALLOW
77 'moodle/backup:backupcourse' => array(
79 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
82 'contextlevel' => CONTEXT_COURSE,
84 'editingteacher' => CAP_ALLOW,
85 'manager' => CAP_ALLOW
88 'clonepermissionsfrom' => 'moodle/site:backup'
91 'moodle/backup:downloadfile' => array(
93 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
96 'contextlevel' => CONTEXT_COURSE,
98 'editingteacher' => CAP_ALLOW,
99 'manager' => CAP_ALLOW
102 'clonepermissionsfrom' => 'moodle/site:backupdownload'
105 'moodle/backup:userinfo' => array(
107 'riskbitmask' => RISK_PERSONAL,
110 'contextlevel' => CONTEXT_COURSE,
112 'manager' => CAP_ALLOW
116 'moodle/restore:restorecourse' => array(
118 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
120 'captype' => 'write',
121 'contextlevel' => CONTEXT_COURSE,
123 'editingteacher' => CAP_ALLOW,
124 'manager' => CAP_ALLOW
127 'clonepermissionsfrom' => 'moodle/site:restore'
130 'moodle/restore:restoretargetimport' => array(
132 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
134 'captype' => 'write',
135 'contextlevel' => CONTEXT_COURSE,
137 'editingteacher' => CAP_ALLOW,
138 'manager' => CAP_ALLOW
141 'clonepermissionsfrom' => 'moodle/site:import'
144 'moodle/restore:uploadfile' => array(
146 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
148 'captype' => 'write',
149 'contextlevel' => CONTEXT_COURSE,
151 'editingteacher' => CAP_ALLOW,
152 'manager' => CAP_ALLOW
155 'clonepermissionsfrom' => 'moodle/site:backupupload'
158 'moodle/restore:userinfo' => array(
160 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
162 'captype' => 'write',
163 'contextlevel' => CONTEXT_COURSE,
165 'manager' => CAP_ALLOW
169 'moodle/restore:createuser' => array(
171 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
173 'captype' => 'write',
174 'contextlevel' => CONTEXT_SYSTEM,
176 'manager' => CAP_ALLOW
180 'moodle/restore:rolldates' => array(
182 'captype' => 'write',
183 'contextlevel' => CONTEXT_COURSE,
185 'coursecreator' => CAP_ALLOW,
186 'manager' => CAP_ALLOW
190 'moodle/site:manageblocks' => array(
192 'riskbitmask' => RISK_SPAM | RISK_XSS,
194 'captype' => 'write',
195 'contextlevel' => CONTEXT_BLOCK,
197 'editingteacher' => CAP_ALLOW,
198 'manager' => CAP_ALLOW
202 'moodle/site:accessallgroups' => array(
205 'contextlevel' => CONTEXT_COURSE,
207 'teacher' => CAP_ALLOW,
208 'editingteacher' => CAP_ALLOW,
209 'manager' => CAP_ALLOW
213 'moodle/site:viewfullnames' => array(
216 'contextlevel' => CONTEXT_COURSE,
218 'teacher' => CAP_ALLOW,
219 'editingteacher' => CAP_ALLOW,
220 'manager' => CAP_ALLOW
224 'moodle/site:viewreports' => array(
226 'riskbitmask' => RISK_PERSONAL,
229 'contextlevel' => CONTEXT_COURSE,
231 'teacher' => CAP_ALLOW,
232 'editingteacher' => CAP_ALLOW,
233 'manager' => CAP_ALLOW
237 'moodle/site:trustcontent' => array(
239 'riskbitmask' => RISK_XSS,
241 'captype' => 'write',
242 'contextlevel' => CONTEXT_COURSE,
244 'editingteacher' => CAP_ALLOW,
245 'manager' => CAP_ALLOW
249 'moodle/site:uploadusers' => array(
251 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
253 'captype' => 'write',
254 'contextlevel' => CONTEXT_SYSTEM,
256 'manager' => CAP_ALLOW
260 'moodle/site:langeditmaster' => array(
262 'riskbitmask' => RISK_CONFIG | RISK_XSS,
264 'captype' => 'write',
265 'contextlevel' => CONTEXT_SYSTEM,
270 'moodle/site:langeditlocal' => array(
272 'riskbitmask' => RISK_CONFIG | RISK_XSS,
274 'captype' => 'write',
275 'contextlevel' => CONTEXT_SYSTEM,
277 'manager' => CAP_ALLOW
281 // Permission to manage filter setting overrides in subcontexts.
282 'moodle/filter:manage' => array(
284 'captype' => 'write',
285 'contextlevel' => CONTEXT_COURSE,
287 'editingteacher' => CAP_ALLOW,
288 'coursecreator' => CAP_ALLOW,
289 'manager' => CAP_ALLOW,
293 'moodle/user:create' => array(
295 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
297 'captype' => 'write',
298 'contextlevel' => CONTEXT_SYSTEM,
300 'manager' => CAP_ALLOW
304 'moodle/user:delete' => array(
306 'riskbitmask' => RISK_PERSONAL, RISK_DATALOSS,
308 'captype' => 'write',
309 'contextlevel' => CONTEXT_SYSTEM,
311 'manager' => CAP_ALLOW
315 'moodle/user:update' => array(
317 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
319 'captype' => 'write',
320 'contextlevel' => CONTEXT_SYSTEM,
322 'manager' => CAP_ALLOW
326 'moodle/user:viewdetails' => array(
329 'contextlevel' => CONTEXT_COURSE,
331 'guest' => CAP_ALLOW,
332 'student' => CAP_ALLOW,
333 'teacher' => CAP_ALLOW,
334 'editingteacher' => CAP_ALLOW,
335 'manager' => CAP_ALLOW
339 'moodle/user:viewhiddendetails' => array(
341 'riskbitmask' => RISK_PERSONAL,
344 'contextlevel' => CONTEXT_COURSE,
346 'teacher' => CAP_ALLOW,
347 'editingteacher' => CAP_ALLOW,
348 'manager' => CAP_ALLOW
352 'moodle/user:loginas' => array(
354 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
356 'captype' => 'write',
357 'contextlevel' => CONTEXT_COURSE,
359 'manager' => CAP_ALLOW
363 'moodle/role:assign' => array(
365 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
367 'captype' => 'write',
368 'contextlevel' => CONTEXT_COURSE,
370 'editingteacher' => CAP_ALLOW,
371 'manager' => CAP_ALLOW
375 'moodle/role:review' => array(
377 'riskbitmask' => RISK_PERSONAL,
380 'contextlevel' => CONTEXT_COURSE,
382 'teacher' => CAP_ALLOW,
383 'editingteacher' => CAP_ALLOW,
384 'manager' => CAP_ALLOW
388 'moodle/role:override' => array(
390 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
392 'captype' => 'write',
393 'contextlevel' => CONTEXT_COURSE,
395 'manager' => CAP_ALLOW
399 'moodle/role:safeoverride' => array(
401 'riskbitmask' => RISK_SPAM,
403 'captype' => 'write',
404 'contextlevel' => CONTEXT_COURSE,
406 'editingteacher' => CAP_ALLOW
410 'moodle/role:manage' => array(
412 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
414 'captype' => 'write',
415 'contextlevel' => CONTEXT_SYSTEM,
417 'manager' => CAP_ALLOW
421 'moodle/role:unassignself' => array(
423 'captype' => 'write',
424 'contextlevel' => CONTEXT_COURSE,
426 'student' => (empty($CFG->allowunenrol)) ? CAP_INHERIT : CAP_ALLOW,
427 'teacher' => CAP_ALLOW,
428 'editingteacher' => CAP_ALLOW,
429 'coursecreator' => CAP_ALLOW,
430 'manager' => CAP_ALLOW
434 'moodle/role:switchroles' => array(
436 'riskbitmask' => RISK_XSS | RISK_PERSONAL,
439 'contextlevel' => CONTEXT_COURSE,
441 'editingteacher' => CAP_ALLOW,
442 'manager' => CAP_ALLOW
446 // Create, update and delete course categories. (Deleting a course category
447 // does not let you delete the courses it contains, unless you also have
448 // moodle/course: delete.) Creating and deleting requires this permission in
449 // the parent category.
450 'moodle/category:manage' => array(
452 'riskbitmask' => RISK_XSS,
454 'captype' => 'write',
455 'contextlevel' => CONTEXT_COURSECAT,
457 'manager' => CAP_ALLOW
459 'clonepermissionsfrom' => 'moodle/category:update'
462 'moodle/category:viewhiddencategories' => array(
465 'contextlevel' => CONTEXT_COURSECAT,
467 'coursecreator' => CAP_ALLOW,
468 'manager' => CAP_ALLOW
470 'clonepermissionsfrom' => 'moodle/category:visibility'
473 // create, delete, move cohorts in system and course categories,
474 // (cohorts with component !== null can be only moved)
475 'moodle/cohort:manage' => array(
477 'captype' => 'write',
478 'contextlevel' => CONTEXT_COURSECAT,
480 'manager' => CAP_ALLOW
484 // add and remove cohort members (only for cohorts where component !== null)
485 'moodle/cohort:assign' => array(
487 'captype' => 'write',
488 'contextlevel' => CONTEXT_COURSECAT,
490 'manager' => CAP_ALLOW
494 // view members of a cohort, this can be used in course context too,
495 // this also controls the ability to actually use cohort
496 'moodle/cohort:view' => array(
499 'contextlevel' => CONTEXT_COURSE,
501 'editingteacher' => CAP_ALLOW,
502 'manager' => CAP_ALLOW
506 'moodle/course:create' => array(
508 'riskbitmask' => RISK_XSS,
510 'captype' => 'write',
511 'contextlevel' => CONTEXT_COURSECAT,
513 'coursecreator' => CAP_ALLOW,
514 'manager' => CAP_ALLOW
518 'moodle/course:request' => array(
519 'captype' => 'write',
520 'contextlevel' => CONTEXT_SYSTEM,
526 'moodle/course:delete' => array(
528 'riskbitmask' => RISK_DATALOSS,
530 'captype' => 'write',
531 'contextlevel' => CONTEXT_COURSE,
533 'editingteacher' => CAP_ALLOW,
534 'manager' => CAP_ALLOW
538 'moodle/course:update' => array(
540 'riskbitmask' => RISK_XSS,
542 'captype' => 'write',
543 'contextlevel' => CONTEXT_COURSE,
545 'editingteacher' => CAP_ALLOW,
546 'manager' => CAP_ALLOW
550 /* originally this capability was called moodle/course:view,
551 * but since 2.0 it is used for access to course without the enrolment
553 'moodle/course:participate' => array(
556 'contextlevel' => CONTEXT_COURSE,
558 'student' => CAP_ALLOW,
559 'teacher' => CAP_ALLOW,
560 'editingteacher' => CAP_ALLOW
564 'moodle/course:view' => array(
567 'contextlevel' => CONTEXT_COURSE,
569 'manager' => CAP_ALLOW,
573 'moodle/course:bulkmessaging' => array(
575 'riskbitmask' => RISK_SPAM,
577 'captype' => 'write',
578 'contextlevel' => CONTEXT_COURSE,
580 'teacher' => CAP_ALLOW,
581 'editingteacher' => CAP_ALLOW,
582 'manager' => CAP_ALLOW
586 'moodle/course:viewhiddenuserfields' => array(
588 'riskbitmask' => RISK_PERSONAL,
591 'contextlevel' => CONTEXT_COURSE,
593 'teacher' => CAP_ALLOW,
594 'editingteacher' => CAP_ALLOW,
595 'manager' => CAP_ALLOW
599 'moodle/course:viewhiddencourses' => array(
602 'contextlevel' => CONTEXT_COURSE,
604 'coursecreator' => CAP_ALLOW,
605 'teacher' => CAP_ALLOW,
606 'editingteacher' => CAP_ALLOW,
607 'manager' => CAP_ALLOW
611 'moodle/course:visibility' => array(
613 'captype' => 'write',
614 'contextlevel' => CONTEXT_COURSE,
616 'manager' => CAP_ALLOW
620 'moodle/course:managefiles' => array(
622 'riskbitmask' => RISK_XSS,
624 'captype' => 'write',
625 'contextlevel' => CONTEXT_COURSE,
627 'editingteacher' => CAP_ALLOW,
628 'manager' => CAP_ALLOW
632 'moodle/course:manageactivities' => array(
634 'riskbitmask' => RISK_XSS,
636 'captype' => 'write',
637 'contextlevel' => CONTEXT_COURSE,
639 'editingteacher' => CAP_ALLOW,
640 'manager' => CAP_ALLOW
644 'moodle/course:managemetacourse' => array(
646 'riskbitmask' => RISK_XSS | RISK_PERSONAL,
648 'captype' => 'write',
649 'contextlevel' => CONTEXT_COURSE,
651 'editingteacher' => CAP_ALLOW,
652 'manager' => CAP_ALLOW
656 'moodle/course:activityvisibility' => array(
658 'captype' => 'write',
659 'contextlevel' => CONTEXT_COURSE,
661 'editingteacher' => CAP_ALLOW,
662 'manager' => CAP_ALLOW
666 'moodle/course:viewhiddenactivities' => array(
668 'captype' => 'write',
669 'contextlevel' => CONTEXT_COURSE,
671 'teacher' => CAP_ALLOW,
672 'editingteacher' => CAP_ALLOW,
673 'manager' => CAP_ALLOW
677 'moodle/course:viewparticipants' => array(
680 'contextlevel' => CONTEXT_COURSE,
682 'student' => CAP_ALLOW,
683 'teacher' => CAP_ALLOW,
684 'editingteacher' => CAP_ALLOW,
685 'manager' => CAP_ALLOW
689 'moodle/course:changefullname' => array(
691 'riskbitmask' => RISK_XSS,
693 'captype' => 'write',
694 'contextlevel' => CONTEXT_COURSE,
696 'editingteacher' => CAP_ALLOW,
697 'manager' => CAP_ALLOW
699 'clonepermissionsfrom' => 'moodle/course:update'
702 'moodle/course:changeshortname' => array(
704 'riskbitmask' => RISK_XSS,
706 'captype' => 'write',
707 'contextlevel' => CONTEXT_COURSE,
709 'editingteacher' => CAP_ALLOW,
710 'manager' => CAP_ALLOW
712 'clonepermissionsfrom' => 'moodle/course:update'
715 'moodle/course:changeidnumber' => array(
717 'riskbitmask' => RISK_XSS,
719 'captype' => 'write',
720 'contextlevel' => CONTEXT_COURSE,
722 'editingteacher' => CAP_ALLOW,
723 'manager' => CAP_ALLOW
725 'clonepermissionsfrom' => 'moodle/course:update'
727 'moodle/course:changecategory' => array(
728 'riskbitmask' => RISK_XSS,
730 'captype' => 'write',
731 'contextlevel' => CONTEXT_COURSE,
733 'editingteacher' => CAP_ALLOW,
734 'manager' => CAP_ALLOW
736 'clonepermissionsfrom' => 'moodle/course:update'
739 'moodle/course:changesummary' => array(
740 'riskbitmask' => RISK_XSS,
742 'captype' => 'write',
743 'contextlevel' => CONTEXT_COURSE,
745 'editingteacher' => CAP_ALLOW,
746 'manager' => CAP_ALLOW
748 'clonepermissionsfrom' => 'moodle/course:update'
752 'moodle/site:viewparticipants' => array(
755 'contextlevel' => CONTEXT_SYSTEM,
757 'manager' => CAP_ALLOW
761 'moodle/course:viewscales' => array(
764 'contextlevel' => CONTEXT_COURSE,
766 'student' => CAP_ALLOW,
767 'teacher' => CAP_ALLOW,
768 'editingteacher' => CAP_ALLOW,
769 'manager' => CAP_ALLOW
773 'moodle/course:managescales' => array(
775 'captype' => 'write',
776 'contextlevel' => CONTEXT_COURSE,
778 'editingteacher' => CAP_ALLOW,
779 'manager' => CAP_ALLOW
783 'moodle/course:managegroups' => array(
785 'captype' => 'write',
786 'contextlevel' => CONTEXT_COURSE,
788 'editingteacher' => CAP_ALLOW,
789 'manager' => CAP_ALLOW
793 'moodle/course:reset' => array(
795 'riskbitmask' => RISK_DATALOSS,
797 'captype' => 'write',
798 'contextlevel' => CONTEXT_COURSE,
800 'editingteacher' => CAP_ALLOW,
801 'manager' => CAP_ALLOW
805 'moodle/blog:view' => array(
808 'contextlevel' => CONTEXT_SYSTEM,
810 'guest' => CAP_ALLOW,
812 'student' => CAP_ALLOW,
813 'teacher' => CAP_ALLOW,
814 'editingteacher' => CAP_ALLOW,
815 'manager' => CAP_ALLOW
819 'moodle/blog:search' => array(
821 'contextlevel' => CONTEXT_SYSTEM,
823 'guest' => CAP_ALLOW,
825 'student' => CAP_ALLOW,
826 'teacher' => CAP_ALLOW,
827 'editingteacher' => CAP_ALLOW,
828 'manager' => CAP_ALLOW
832 'moodle/blog:viewdrafts' => array(
834 'riskbitmask' => RISK_PERSONAL,
836 'contextlevel' => CONTEXT_SYSTEM,
838 'manager' => CAP_ALLOW
842 'moodle/blog:create' => array( // works in CONTEXT_SYSTEM only
844 'riskbitmask' => RISK_SPAM,
846 'captype' => 'write',
847 'contextlevel' => CONTEXT_SYSTEM,
850 'manager' => CAP_ALLOW
854 'moodle/blog:manageentries' => array(
856 'riskbitmask' => RISK_SPAM,
858 'captype' => 'write',
859 'contextlevel' => CONTEXT_SYSTEM,
861 'teacher' => CAP_ALLOW,
862 'editingteacher' => CAP_ALLOW,
863 'manager' => CAP_ALLOW
867 'moodle/blog:manageexternal' => array(
869 'riskbitmask' => RISK_SPAM,
871 'captype' => 'write',
872 'contextlevel' => CONTEXT_USER,
874 'student' => CAP_ALLOW,
876 'teacher' => CAP_ALLOW,
877 'editingteacher' => CAP_ALLOW,
878 'manager' => CAP_ALLOW
882 'moodle/blog:associatecourse' => array(
884 'captype' => 'write',
885 'contextlevel' => CONTEXT_COURSE,
887 'student' => CAP_ALLOW,
889 'teacher' => CAP_ALLOW,
890 'editingteacher' => CAP_ALLOW,
891 'manager' => CAP_ALLOW
895 'moodle/blog:associatemodule' => array(
897 'captype' => 'write',
898 'contextlevel' => CONTEXT_MODULE,
900 'student' => CAP_ALLOW,
902 'teacher' => CAP_ALLOW,
903 'editingteacher' => CAP_ALLOW,
904 'manager' => CAP_ALLOW
908 'moodle/calendar:manageownentries' => array( // works in CONTEXT_SYSTEM only
910 'riskbitmask' => RISK_SPAM,
912 'captype' => 'write',
913 'contextlevel' => CONTEXT_COURSE,
916 'manager' => CAP_ALLOW
920 'moodle/calendar:managegroupentries' => array(
922 'riskbitmask' => RISK_SPAM,
924 'captype' => 'write',
925 'contextlevel' => CONTEXT_COURSE,
927 'teacher' => CAP_ALLOW,
928 'editingteacher' => CAP_ALLOW,
929 'manager' => CAP_ALLOW
933 'moodle/calendar:manageentries' => array(
935 'riskbitmask' => RISK_SPAM,
937 'captype' => 'write',
938 'contextlevel' => CONTEXT_COURSE,
940 'teacher' => CAP_ALLOW,
941 'editingteacher' => CAP_ALLOW,
942 'manager' => CAP_ALLOW
946 'moodle/user:editprofile' => array(
948 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
950 'captype' => 'write',
951 'contextlevel' => CONTEXT_USER,
953 'manager' => CAP_ALLOW
957 'moodle/user:editownprofile' => array(
959 'riskbitmask' => RISK_SPAM,
961 'captype' => 'write',
962 'contextlevel' => CONTEXT_SYSTEM,
964 'guest' => CAP_PROHIBIT,
966 'manager' => CAP_ALLOW
970 'moodle/user:changeownpassword' => array(
972 'captype' => 'write',
973 'contextlevel' => CONTEXT_SYSTEM,
975 'guest' => CAP_PROHIBIT,
977 'manager' => CAP_ALLOW
981 // The next 3 might make no sense for some roles, e.g teacher, etc.
982 // since the next level up is site. These are more for the parent role
983 'moodle/user:readuserposts' => array(
986 'contextlevel' => CONTEXT_USER,
988 'student' => CAP_ALLOW,
989 'teacher' => CAP_ALLOW,
990 'editingteacher' => CAP_ALLOW,
991 'manager' => CAP_ALLOW
995 'moodle/user:readuserblogs' => array(
998 'contextlevel' => CONTEXT_USER,
1000 'student' => CAP_ALLOW,
1001 'teacher' => CAP_ALLOW,
1002 'editingteacher' => CAP_ALLOW,
1003 'manager' => CAP_ALLOW
1007 // designed for parent role - not used in legacy roles
1008 'moodle/user:viewuseractivitiesreport' => array(
1009 'riskbitmask' => RISK_PERSONAL,
1011 'captype' => 'read',
1012 'contextlevel' => CONTEXT_USER,
1017 //capabilities designed for the new message system configuration
1018 'moodle/user:editmessageprofile' => array(
1020 'riskbitmask' => RISK_SPAM,
1022 'captype' => 'write',
1023 'contextlevel' => CONTEXT_USER,
1025 'manager' => CAP_ALLOW
1029 'moodle/user:editownmessageprofile' => array(
1031 'captype' => 'write',
1032 'contextlevel' => CONTEXT_SYSTEM,
1034 'guest' => CAP_PROHIBIT,
1035 'user' => CAP_ALLOW,
1036 'manager' => CAP_ALLOW
1040 'moodle/question:managecategory' => array(
1041 'riskbitmask' => RISK_SPAM | RISK_XSS,
1042 'captype' => 'write',
1043 'contextlevel' => CONTEXT_COURSE,
1045 'editingteacher' => CAP_ALLOW,
1046 'manager' => CAP_ALLOW
1051 'moodle/question:add' => array(
1052 'riskbitmask' => RISK_SPAM | RISK_XSS,
1053 'captype' => 'write',
1054 'contextlevel' => CONTEXT_COURSE,
1056 'editingteacher' => CAP_ALLOW,
1057 'manager' => CAP_ALLOW
1059 'clonepermissionsfrom' => 'moodle/question:manage'
1061 'moodle/question:editmine' => array(
1062 'riskbitmask' => RISK_SPAM | RISK_XSS,
1063 'captype' => 'write',
1064 'contextlevel' => CONTEXT_COURSE,
1066 'editingteacher' => CAP_ALLOW,
1067 'manager' => CAP_ALLOW
1069 'clonepermissionsfrom' => 'moodle/question:manage'
1071 'moodle/question:editall' => array(
1072 'riskbitmask' => RISK_SPAM | RISK_XSS,
1073 'captype' => 'write',
1074 'contextlevel' => CONTEXT_COURSE,
1076 'editingteacher' => CAP_ALLOW,
1077 'manager' => CAP_ALLOW
1079 'clonepermissionsfrom' => 'moodle/question:manage'
1081 'moodle/question:viewmine' => array(
1082 'captype' => 'read',
1083 'contextlevel' => CONTEXT_COURSE,
1085 'editingteacher' => CAP_ALLOW,
1086 'manager' => CAP_ALLOW
1088 'clonepermissionsfrom' => 'moodle/question:manage'
1090 'moodle/question:viewall' => array(
1091 'captype' => 'read',
1092 'contextlevel' => CONTEXT_COURSE,
1094 'editingteacher' => CAP_ALLOW,
1095 'manager' => CAP_ALLOW
1097 'clonepermissionsfrom' => 'moodle/question:manage'
1099 'moodle/question:usemine' => array(
1100 'captype' => 'read',
1101 'contextlevel' => CONTEXT_COURSE,
1103 'editingteacher' => CAP_ALLOW,
1104 'manager' => CAP_ALLOW
1106 'clonepermissionsfrom' => 'moodle/question:manage'
1108 'moodle/question:useall' => array(
1109 'captype' => 'read',
1110 'contextlevel' => CONTEXT_COURSE,
1112 'editingteacher' => CAP_ALLOW,
1113 'manager' => CAP_ALLOW
1115 'clonepermissionsfrom' => 'moodle/question:manage'
1117 'moodle/question:movemine' => array(
1118 'captype' => 'write',
1119 'contextlevel' => CONTEXT_COURSE,
1121 'editingteacher' => CAP_ALLOW,
1122 'manager' => CAP_ALLOW
1124 'clonepermissionsfrom' => 'moodle/question:manage'
1126 'moodle/question:moveall' => array(
1127 'captype' => 'write',
1128 'contextlevel' => CONTEXT_COURSE,
1130 'editingteacher' => CAP_ALLOW,
1131 'manager' => CAP_ALLOW
1133 'clonepermissionsfrom' => 'moodle/question:manage'
1135 //END new in moodle 1.9
1137 // Configure the installed question types.
1138 'moodle/question:config' => array(
1139 'riskbitmask' => RISK_CONFIG,
1140 'captype' => 'write',
1141 'contextlevel' => CONTEXT_SYSTEM,
1143 'manager' => CAP_ALLOW
1147 // While attempting questions, the ability to flag particular questions for later reference.
1148 'moodle/question:flag' => array(
1149 'captype' => 'write',
1150 'contextlevel' => CONTEXT_COURSE,
1152 'student' => CAP_ALLOW,
1153 'teacher' => CAP_ALLOW,
1154 'editingteacher' => CAP_ALLOW,
1155 'coursecreator' => CAP_ALLOW,
1156 'manager' => CAP_ALLOW
1160 'moodle/site:doclinks' => array(
1161 'captype' => 'read',
1162 'contextlevel' => CONTEXT_SYSTEM,
1164 'teacher' => CAP_ALLOW,
1165 'editingteacher' => CAP_ALLOW,
1166 'manager' => CAP_ALLOW
1170 'moodle/course:sectionvisibility' => array(
1172 'captype' => 'write',
1173 'contextlevel' => CONTEXT_COURSE,
1175 'editingteacher' => CAP_ALLOW,
1176 'manager' => CAP_ALLOW
1180 'moodle/course:useremail' => array(
1182 'captype' => 'write',
1183 'contextlevel' => CONTEXT_COURSE,
1185 'editingteacher' => CAP_ALLOW,
1186 'manager' => CAP_ALLOW
1190 'moodle/course:viewhiddensections' => array(
1192 'captype' => 'write',
1193 'contextlevel' => CONTEXT_COURSE,
1195 'editingteacher' => CAP_ALLOW,
1196 'manager' => CAP_ALLOW
1200 'moodle/course:setcurrentsection' => array(
1202 'captype' => 'write',
1203 'contextlevel' => CONTEXT_COURSE,
1205 'editingteacher' => CAP_ALLOW,
1206 'manager' => CAP_ALLOW
1210 'moodle/site:mnetlogintoremote' => array(
1212 'captype' => 'read',
1213 'contextlevel' => CONTEXT_SYSTEM,
1215 'manager' => CAP_ALLOW
1219 'moodle/grade:viewall' => array(
1220 'riskbitmask' => RISK_PERSONAL,
1221 'captype' => 'read',
1222 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_USER
1224 'teacher' => CAP_ALLOW,
1225 'editingteacher' => CAP_ALLOW,
1226 'manager' => CAP_ALLOW
1228 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
1231 'moodle/grade:view' => array(
1232 'captype' => 'read',
1233 'contextlevel' => CONTEXT_COURSE,
1235 'student' => CAP_ALLOW
1239 'moodle/grade:viewhidden' => array(
1240 'riskbitmask' => RISK_PERSONAL,
1241 'captype' => 'read',
1242 'contextlevel' => CONTEXT_COURSE,
1244 'teacher' => CAP_ALLOW,
1245 'editingteacher' => CAP_ALLOW,
1246 'manager' => CAP_ALLOW
1248 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
1251 'moodle/grade:import' => array(
1252 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
1253 'captype' => 'write',
1254 'contextlevel' => CONTEXT_COURSE,
1256 'editingteacher' => CAP_ALLOW,
1257 'manager' => CAP_ALLOW
1259 'clonepermissionsfrom' => 'moodle/course:managegrades'
1262 'moodle/grade:export' => array(
1263 'riskbitmask' => RISK_PERSONAL,
1264 'captype' => 'read',
1265 'contextlevel' => CONTEXT_COURSE,
1267 'teacher' => CAP_ALLOW,
1268 'editingteacher' => CAP_ALLOW,
1269 'manager' => CAP_ALLOW
1271 'clonepermissionsfrom' => 'moodle/course:managegrades'
1274 'moodle/grade:manage' => array(
1275 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
1276 'captype' => 'write',
1277 'contextlevel' => CONTEXT_COURSE,
1279 'editingteacher' => CAP_ALLOW,
1280 'manager' => CAP_ALLOW
1282 'clonepermissionsfrom' => 'moodle/course:managegrades'
1285 'moodle/grade:edit' => array(
1286 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
1287 'captype' => 'write',
1288 'contextlevel' => CONTEXT_COURSE,
1290 'editingteacher' => CAP_ALLOW,
1291 'manager' => CAP_ALLOW
1293 'clonepermissionsfrom' => 'moodle/course:managegrades'
1296 'moodle/grade:manageoutcomes' => array(
1297 'captype' => 'write',
1298 'contextlevel' => CONTEXT_COURSE,
1300 'editingteacher' => CAP_ALLOW,
1301 'manager' => CAP_ALLOW
1303 'clonepermissionsfrom' => 'moodle/course:managegrades'
1306 'moodle/grade:manageletters' => array(
1307 'captype' => 'write',
1308 'contextlevel' => CONTEXT_COURSE,
1310 'editingteacher' => CAP_ALLOW,
1311 'manager' => CAP_ALLOW
1313 'clonepermissionsfrom' => 'moodle/course:managegrades'
1316 'moodle/grade:hide' => array(
1317 'captype' => 'write',
1318 'contextlevel' => CONTEXT_COURSE,
1320 'editingteacher' => CAP_ALLOW,
1321 'manager' => CAP_ALLOW
1325 'moodle/grade:lock' => array(
1326 'captype' => 'write',
1327 'contextlevel' => CONTEXT_COURSE,
1329 'editingteacher' => CAP_ALLOW,
1330 'manager' => CAP_ALLOW
1334 'moodle/grade:unlock' => array(
1335 'captype' => 'write',
1336 'contextlevel' => CONTEXT_COURSE,
1338 'editingteacher' => CAP_ALLOW,
1339 'manager' => CAP_ALLOW
1343 'moodle/my:manageblocks' => array(
1344 'captype' => 'write',
1345 'contextlevel' => CONTEXT_SYSTEM,
1351 'moodle/notes:view' => array(
1352 'captype' => 'read',
1353 'contextlevel' => CONTEXT_COURSE,
1355 'teacher' => CAP_ALLOW,
1356 'editingteacher' => CAP_ALLOW,
1357 'manager' => CAP_ALLOW
1361 'moodle/notes:manage' => array(
1362 'riskbitmask' => RISK_SPAM,
1364 'captype' => 'write',
1365 'contextlevel' => CONTEXT_COURSE,
1367 'teacher' => CAP_ALLOW,
1368 'editingteacher' => CAP_ALLOW,
1369 'manager' => CAP_ALLOW
1373 'moodle/tag:manage' => array(
1374 'riskbitmask' => RISK_SPAM,
1376 'captype' => 'write',
1377 'contextlevel' => CONTEXT_SYSTEM,
1379 'teacher' => CAP_ALLOW,
1380 'editingteacher' => CAP_ALLOW,
1381 'manager' => CAP_ALLOW
1385 'moodle/tag:create' => array(
1386 'riskbitmask' => RISK_SPAM,
1388 'captype' => 'write',
1389 'contextlevel' => CONTEXT_SYSTEM,
1391 'manager' => CAP_ALLOW,
1396 'moodle/tag:edit' => array(
1397 'riskbitmask' => RISK_SPAM,
1399 'captype' => 'write',
1400 'contextlevel' => CONTEXT_SYSTEM,
1402 'manager' => CAP_ALLOW,
1407 'moodle/tag:editblocks' => array(
1408 'captype' => 'write',
1409 'contextlevel' => CONTEXT_SYSTEM,
1411 'teacher' => CAP_ALLOW,
1412 'editingteacher' => CAP_ALLOW,
1413 'manager' => CAP_ALLOW
1417 'moodle/block:view' => array(
1418 'captype' => 'read',
1419 'contextlevel' => CONTEXT_BLOCK,
1421 'guest' => CAP_ALLOW,
1422 'user' => CAP_ALLOW,
1423 'student' => CAP_ALLOW,
1424 'teacher' => CAP_ALLOW,
1425 'editingteacher' => CAP_ALLOW,
1426 'coursecreator' => CAP_ALLOW
1430 'moodle/block:edit' => array(
1431 'riskbitmask' => RISK_SPAM | RISK_XSS,
1433 'captype' => 'write',
1434 'contextlevel' => CONTEXT_BLOCK,
1436 'editingteacher' => CAP_ALLOW,
1437 'coursecreator' => CAP_ALLOW
1441 'moodle/portfolio:export' => array(
1442 'captype' => 'read',
1443 'contextlevel' => CONTEXT_SYSTEM,
1445 'user' => CAP_ALLOW,
1446 'student' => CAP_ALLOW,
1447 'teacher' => CAP_ALLOW,
1448 'editingteacher' => CAP_ALLOW,
1449 'coursecreator' => CAP_ALLOW
1452 'moodle/comment:view' => array(
1454 'captype' => 'read',
1455 'contextlevel' => CONTEXT_SYSTEM,
1457 'user' => CAP_ALLOW,
1458 'student' => CAP_ALLOW,
1459 'teacher' => CAP_ALLOW,
1460 'editingteacher' => CAP_ALLOW,
1461 'coursecreator' => CAP_ALLOW,
1462 'manager' => CAP_ALLOW
1465 'moodle/comment:post' => array(
1467 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
1468 'captype' => 'write',
1469 'contextlevel' => CONTEXT_SYSTEM,
1471 'user' => CAP_ALLOW,
1472 'student' => CAP_ALLOW,
1473 'teacher' => CAP_ALLOW,
1474 'editingteacher' => CAP_ALLOW,
1475 'coursecreator' => CAP_ALLOW,
1476 'manager' => CAP_ALLOW
1479 'moodle/comment:delete' => array(
1481 'riskbitmask' => RISK_DATALOSS,
1482 'captype' => 'write',
1483 'contextlevel' => CONTEXT_SYSTEM,
1485 'editingteacher' => CAP_ALLOW,
1486 'coursecreator' => CAP_ALLOW,
1487 'manager' => CAP_ALLOW
1490 'moodle/webservice:createtoken' => array(
1492 'riskbitmask' => RISK_CONFIG | RISK_DATALOSS | RISK_SPAM | RISK_PERSONAL | RISK_XSS,
1493 'captype' => 'write',
1494 'contextlevel' => CONTEXT_SYSTEM,
1496 'manager' => CAP_ALLOW
1499 'moodle/rating:view' => array(
1500 'captype' => 'read',
1501 'contextlevel' => CONTEXT_SYSTEM,
1503 'student' => CAP_ALLOW,
1504 'teacher' => CAP_ALLOW,
1505 'editingteacher' => CAP_ALLOW,
1506 'manager' => CAP_ALLOW
1509 'moodle/rating:viewany' => array(
1510 'riskbitmask' => RISK_PERSONAL,
1511 'captype' => 'read',
1512 'contextlevel' => CONTEXT_SYSTEM,
1514 'student' => CAP_ALLOW,
1515 'teacher' => CAP_ALLOW,
1516 'editingteacher' => CAP_ALLOW,
1517 'manager' => CAP_ALLOW
1520 'moodle/rating:viewall' => array(
1521 'riskbitmask' => RISK_PERSONAL,
1522 'captype' => 'read',
1523 'contextlevel' => CONTEXT_SYSTEM,
1525 'student' => CAP_ALLOW,
1526 'teacher' => CAP_ALLOW,
1527 'editingteacher' => CAP_ALLOW,
1528 'manager' => CAP_ALLOW
1531 'moodle/rating:rate' => array(
1532 'captype' => 'write',
1533 'contextlevel' => CONTEXT_SYSTEM,
1535 'student' => CAP_ALLOW,
1536 'teacher' => CAP_ALLOW,
1537 'editingteacher' => CAP_ALLOW,
1538 'manager' => CAP_ALLOW