MDL-61444 question: add question tagmine and tagall capabilities
[moodle.git] / lib / db / access.php
blob1652534349e190bbb2a78ece4424de461af77114
1 <?php
2 // This file is part of Moodle - http://moodle.org/
3 //
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
17 /**
18 * Capability definitions for Moodle core.
20 * The capabilities are loaded into the database table when the module is
21 * installed or updated. Whenever the capability definitions are updated,
22 * the module version number should be bumped up.
24 * The system has four possible values for a capability:
25 * CAP_ALLOW, CAP_PREVENT, CAP_PROHIBIT, and inherit (not set).
28 * CAPABILITY NAMING CONVENTION
30 * It is important that capability names are unique. The naming convention
31 * for capabilities that are specific to modules and blocks is as follows:
32 * [mod/block]/<plugin_name>:<capabilityname>
34 * component_name should be the same as the directory name of the mod or block.
36 * Core moodle capabilities are defined thus:
37 * moodle/<capabilityclass>:<capabilityname>
39 * Examples: mod/forum:viewpost
40 * block/recent_activity:view
41 * moodle/site:deleteuser
43 * The variable name for the capability definitions array is $capabilities
45 * For more information, take a look to the documentation available:
46 * - Access API: {@link http://docs.moodle.org/dev/Access_API}
47 * - Upgrade API: {@link http://docs.moodle.org/dev/Upgrade_API}
49 * @package core_access
50 * @category access
51 * @copyright 2006 onwards Martin Dougiamas http://dougiamas.com
52 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
55 defined('MOODLE_INTERNAL') || die();
57 $capabilities = array(
58 'moodle/site:config' => array(
60 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG | RISK_DATALOSS,
62 'captype' => 'write',
63 'contextlevel' => CONTEXT_SYSTEM,
64 'archetypes' => array(
67 'moodle/site:configview' => array(
68 'captype' => 'read',
69 'contextlevel' => CONTEXT_SYSTEM,
70 'archetypes' => array(
71 'manager' => CAP_ALLOW,
72 'coursecreator' => CAP_ALLOW,
76 'moodle/site:readallmessages' => array(
78 'riskbitmask' => RISK_PERSONAL,
80 'captype' => 'read',
81 'contextlevel' => CONTEXT_SYSTEM,
82 'archetypes' => array(
83 'manager' => CAP_ALLOW,
84 'editingteacher' => CAP_ALLOW
88 'moodle/site:manageallmessaging' => array(
90 'riskbitmask' => RISK_PERSONAL,
92 'captype' => 'write',
93 'contextlevel' => CONTEXT_SYSTEM,
94 'archetypes' => array(
95 'manager' => CAP_ALLOW
99 'moodle/site:deleteanymessage' => array(
101 'riskbitmask' => RISK_DATALOSS,
103 'captype' => 'write',
104 'contextlevel' => CONTEXT_SYSTEM,
105 'archetypes' => array(
106 'manager' => CAP_ALLOW
110 'moodle/site:sendmessage' => array(
112 'riskbitmask' => RISK_SPAM,
114 'captype' => 'write',
115 'contextlevel' => CONTEXT_SYSTEM,
116 'archetypes' => array(
117 'manager' => CAP_ALLOW,
118 'user' => CAP_ALLOW
122 'moodle/site:deleteownmessage' => array(
124 'captype' => 'write',
125 'contextlevel' => CONTEXT_SYSTEM,
126 'archetypes' => array(
127 'user' => CAP_ALLOW
131 'moodle/site:approvecourse' => array(
133 'riskbitmask' => RISK_XSS,
135 'captype' => 'write',
136 'contextlevel' => CONTEXT_SYSTEM,
137 'archetypes' => array(
138 'manager' => CAP_ALLOW
142 'moodle/backup:backupcourse' => array(
144 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
146 'captype' => 'write',
147 'contextlevel' => CONTEXT_COURSE,
148 'archetypes' => array(
149 'editingteacher' => CAP_ALLOW,
150 'manager' => CAP_ALLOW
153 'clonepermissionsfrom' => 'moodle/site:backup'
156 'moodle/backup:backupsection' => array(
158 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
160 'captype' => 'write',
161 'contextlevel' => CONTEXT_COURSE,
162 'archetypes' => array(
163 'editingteacher' => CAP_ALLOW,
164 'manager' => CAP_ALLOW
167 'clonepermissionsfrom' => 'moodle/backup:backupcourse'
170 'moodle/backup:backupactivity' => array(
172 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
174 'captype' => 'write',
175 'contextlevel' => CONTEXT_MODULE,
176 'archetypes' => array(
177 'editingteacher' => CAP_ALLOW,
178 'manager' => CAP_ALLOW
181 'clonepermissionsfrom' => 'moodle/backup:backupcourse'
184 'moodle/backup:backuptargethub' => array(
186 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
188 'captype' => 'write',
189 'contextlevel' => CONTEXT_COURSE,
190 'archetypes' => array(
191 'editingteacher' => CAP_ALLOW,
192 'manager' => CAP_ALLOW
195 'clonepermissionsfrom' => 'moodle/backup:backupcourse'
198 'moodle/backup:backuptargetimport' => array(
200 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
202 'captype' => 'write',
203 'contextlevel' => CONTEXT_COURSE,
204 'archetypes' => array(
205 'editingteacher' => CAP_ALLOW,
206 'manager' => CAP_ALLOW
209 'clonepermissionsfrom' => 'moodle/backup:backupcourse'
212 'moodle/backup:downloadfile' => array(
214 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
216 'captype' => 'write',
217 'contextlevel' => CONTEXT_COURSE,
218 'archetypes' => array(
219 'editingteacher' => CAP_ALLOW,
220 'manager' => CAP_ALLOW
223 'clonepermissionsfrom' => 'moodle/site:backupdownload'
226 'moodle/backup:configure' => array(
228 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
230 'captype' => 'write',
231 'contextlevel' => CONTEXT_COURSE,
232 'archetypes' => array(
233 'editingteacher' => CAP_ALLOW,
234 'manager' => CAP_ALLOW
238 'moodle/backup:userinfo' => array(
240 'riskbitmask' => RISK_PERSONAL,
242 'captype' => 'read',
243 'contextlevel' => CONTEXT_COURSE,
244 'archetypes' => array(
245 'manager' => CAP_ALLOW
249 'moodle/backup:anonymise' => array(
251 'riskbitmask' => RISK_PERSONAL,
253 'captype' => 'read',
254 'contextlevel' => CONTEXT_COURSE,
255 'archetypes' => array(
256 'manager' => CAP_ALLOW
260 'moodle/restore:restorecourse' => array(
262 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
264 'captype' => 'write',
265 'contextlevel' => CONTEXT_COURSE,
266 'archetypes' => array(
267 'editingteacher' => CAP_ALLOW,
268 'manager' => CAP_ALLOW
271 'clonepermissionsfrom' => 'moodle/site:restore'
274 'moodle/restore:restoresection' => array(
276 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
278 'captype' => 'write',
279 'contextlevel' => CONTEXT_COURSE,
280 'archetypes' => array(
281 'editingteacher' => CAP_ALLOW,
282 'manager' => CAP_ALLOW
285 'clonepermissionsfrom' => 'moodle/restore:restorecourse'
288 'moodle/restore:restoreactivity' => array(
290 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
292 'captype' => 'write',
293 'contextlevel' => CONTEXT_COURSE,
294 'archetypes' => array(
295 'editingteacher' => CAP_ALLOW,
296 'manager' => CAP_ALLOW
299 'clonepermissionsfrom' => 'moodle/restore:restorecourse'
302 'moodle/restore:viewautomatedfilearea' => array(
304 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
306 'captype' => 'write',
307 'contextlevel' => CONTEXT_COURSE,
308 'archetypes' => array(
309 'editingteacher' => CAP_ALLOW,
310 'manager' => CAP_ALLOW
314 'moodle/restore:restoretargethub' => array(
316 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
318 'captype' => 'write',
319 'contextlevel' => CONTEXT_COURSE,
320 'archetypes' => array(
321 'editingteacher' => CAP_ALLOW,
322 'manager' => CAP_ALLOW
325 'clonepermissionsfrom' => 'moodle/restore:restorecourse'
328 'moodle/restore:restoretargetimport' => array(
330 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
332 'captype' => 'write',
333 'contextlevel' => CONTEXT_COURSE,
334 'archetypes' => array(
335 'editingteacher' => CAP_ALLOW,
336 'manager' => CAP_ALLOW
339 'clonepermissionsfrom' => 'moodle/site:import'
342 'moodle/restore:uploadfile' => array(
344 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
346 'captype' => 'write',
347 'contextlevel' => CONTEXT_COURSE,
348 'archetypes' => array(
349 'editingteacher' => CAP_ALLOW,
350 'manager' => CAP_ALLOW
353 'clonepermissionsfrom' => 'moodle/site:backupupload'
356 'moodle/restore:configure' => array(
358 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
360 'captype' => 'write',
361 'contextlevel' => CONTEXT_COURSE,
362 'archetypes' => array(
363 'editingteacher' => CAP_ALLOW,
364 'manager' => CAP_ALLOW
368 'moodle/restore:rolldates' => array(
370 'captype' => 'write',
371 'contextlevel' => CONTEXT_COURSE,
372 'archetypes' => array(
373 'coursecreator' => CAP_ALLOW,
374 'manager' => CAP_ALLOW
378 'moodle/restore:userinfo' => array(
380 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
382 'captype' => 'write',
383 'contextlevel' => CONTEXT_COURSE,
384 'archetypes' => array(
385 'manager' => CAP_ALLOW
389 'moodle/restore:createuser' => array(
391 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
393 'captype' => 'write',
394 'contextlevel' => CONTEXT_SYSTEM,
395 'archetypes' => array(
396 'manager' => CAP_ALLOW
400 'moodle/site:manageblocks' => array(
402 'riskbitmask' => RISK_SPAM | RISK_XSS,
404 'captype' => 'write',
405 'contextlevel' => CONTEXT_BLOCK,
406 'archetypes' => array(
407 'editingteacher' => CAP_ALLOW,
408 'manager' => CAP_ALLOW
412 'moodle/site:accessallgroups' => array(
414 'captype' => 'read',
415 'contextlevel' => CONTEXT_COURSE,
416 'archetypes' => array(
417 'editingteacher' => CAP_ALLOW,
418 'manager' => CAP_ALLOW
422 'moodle/site:viewfullnames' => array(
424 'captype' => 'read',
425 'contextlevel' => CONTEXT_COURSE,
426 'archetypes' => array(
427 'teacher' => CAP_ALLOW,
428 'editingteacher' => CAP_ALLOW,
429 'manager' => CAP_ALLOW
433 // In reports that give lists of users, extra information about each user's
434 // identity (the fields configured in site option showuseridentity) will be
435 // displayed to users who have this capability.
436 'moodle/site:viewuseridentity' => array(
438 'captype' => 'read',
439 'contextlevel' => CONTEXT_COURSE,
440 'archetypes' => array(
441 'teacher' => CAP_ALLOW,
442 'editingteacher' => CAP_ALLOW,
443 'manager' => CAP_ALLOW
447 'moodle/site:viewreports' => array(
449 'riskbitmask' => RISK_PERSONAL,
451 'captype' => 'read',
452 'contextlevel' => CONTEXT_COURSE,
453 'archetypes' => array(
454 'teacher' => CAP_ALLOW,
455 'editingteacher' => CAP_ALLOW,
456 'manager' => CAP_ALLOW
460 'moodle/site:trustcontent' => array(
462 'riskbitmask' => RISK_XSS,
464 'captype' => 'write',
465 'contextlevel' => CONTEXT_COURSE,
466 'archetypes' => array(
467 'editingteacher' => CAP_ALLOW,
468 'manager' => CAP_ALLOW
472 'moodle/site:uploadusers' => array(
474 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
476 'captype' => 'write',
477 'contextlevel' => CONTEXT_SYSTEM,
478 'archetypes' => array(
479 'manager' => CAP_ALLOW
483 // Permission to manage filter setting overrides in subcontexts.
484 'moodle/filter:manage' => array(
486 'captype' => 'write',
487 'contextlevel' => CONTEXT_COURSE,
488 'archetypes' => array(
489 'editingteacher' => CAP_ALLOW,
490 'manager' => CAP_ALLOW,
494 'moodle/user:create' => array(
496 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
498 'captype' => 'write',
499 'contextlevel' => CONTEXT_SYSTEM,
500 'archetypes' => array(
501 'manager' => CAP_ALLOW
505 'moodle/user:delete' => array(
507 'riskbitmask' => RISK_PERSONAL | RISK_DATALOSS,
509 'captype' => 'write',
510 'contextlevel' => CONTEXT_SYSTEM,
511 'archetypes' => array(
512 'manager' => CAP_ALLOW
516 'moodle/user:update' => array(
518 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
520 'captype' => 'write',
521 'contextlevel' => CONTEXT_SYSTEM,
522 'archetypes' => array(
523 'manager' => CAP_ALLOW
527 'moodle/user:viewdetails' => array(
529 'captype' => 'read',
530 'contextlevel' => CONTEXT_COURSE,
531 'archetypes' => array(
532 'guest' => CAP_ALLOW,
533 'student' => CAP_ALLOW,
534 'teacher' => CAP_ALLOW,
535 'editingteacher' => CAP_ALLOW,
536 'manager' => CAP_ALLOW
540 'moodle/user:viewalldetails' => array(
541 'riskbitmask' => RISK_PERSONAL,
542 'captype' => 'read',
543 'contextlevel' => CONTEXT_USER,
544 'archetypes' => array(
545 'manager' => CAP_ALLOW
547 'clonepermissionsfrom' => 'moodle/user:update'
550 'moodle/user:viewlastip' => array(
551 'riskbitmask' => RISK_PERSONAL,
552 'captype' => 'read',
553 'contextlevel' => CONTEXT_USER,
554 'archetypes' => array(
555 'manager' => CAP_ALLOW
557 'clonepermissionsfrom' => 'moodle/user:update'
560 'moodle/user:viewhiddendetails' => array(
562 'riskbitmask' => RISK_PERSONAL,
564 'captype' => 'read',
565 'contextlevel' => CONTEXT_COURSE,
566 'archetypes' => array(
567 'teacher' => CAP_ALLOW,
568 'editingteacher' => CAP_ALLOW,
569 'manager' => CAP_ALLOW
573 'moodle/user:loginas' => array(
575 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
577 'captype' => 'write',
578 'contextlevel' => CONTEXT_COURSE,
579 'archetypes' => array(
580 'manager' => CAP_ALLOW
584 // can the user manage the system default profile page?
585 'moodle/user:managesyspages' => array(
587 'riskbitmap' => RISK_SPAM | RISK_PERSONAL | RISK_CONFIG,
589 'captype' => 'write',
590 'contextlevel' => CONTEXT_SYSTEM,
591 'archetypes' => array(
592 'manager' => CAP_ALLOW
596 // can the user manage another user's profile page?
597 'moodle/user:manageblocks' => array(
599 'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
601 'captype' => 'write',
602 'contextlevel' => CONTEXT_USER
605 // can the user manage their own profile page?
606 'moodle/user:manageownblocks' => array(
608 'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
610 'captype' => 'write',
611 'contextlevel' => CONTEXT_SYSTEM,
612 'archetypes' => array(
613 'user' => CAP_ALLOW
617 // can the user manage their own files?
618 'moodle/user:manageownfiles' => array(
620 'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
622 'captype' => 'write',
623 'contextlevel' => CONTEXT_SYSTEM,
624 'archetypes' => array(
625 'user' => CAP_ALLOW
629 // Can the user ignore the setting userquota?
630 // The permissions are cloned from ignorefilesizelimits as it was partly used for that purpose.
631 'moodle/user:ignoreuserquota' => array(
632 'riskbitmap' => RISK_SPAM,
633 'captype' => 'write',
634 'contextlevel' => CONTEXT_SYSTEM,
635 'clonepermissionsfrom' => 'moodle/course:ignorefilesizelimits'
638 // can the user manage the system default dashboard page?
639 'moodle/my:configsyspages' => array(
641 'riskbitmap' => RISK_SPAM | RISK_PERSONAL | RISK_CONFIG,
643 'captype' => 'write',
644 'contextlevel' => CONTEXT_SYSTEM,
645 'archetypes' => array(
646 'manager' => CAP_ALLOW
650 'moodle/role:assign' => array(
652 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
654 'captype' => 'write',
655 'contextlevel' => CONTEXT_COURSE,
656 'archetypes' => array(
657 'editingteacher' => CAP_ALLOW,
658 'manager' => CAP_ALLOW
662 'moodle/role:review' => array(
664 'riskbitmask' => RISK_PERSONAL,
666 'captype' => 'read',
667 'contextlevel' => CONTEXT_COURSE,
668 'archetypes' => array(
669 'teacher' => CAP_ALLOW,
670 'editingteacher' => CAP_ALLOW,
671 'manager' => CAP_ALLOW
675 'moodle/role:override' => array(
677 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
679 'captype' => 'write',
680 'contextlevel' => CONTEXT_COURSE,
681 'archetypes' => array(
682 'manager' => CAP_ALLOW
686 'moodle/role:safeoverride' => array(
688 'riskbitmask' => RISK_SPAM,
690 'captype' => 'write',
691 'contextlevel' => CONTEXT_COURSE,
692 'archetypes' => array(
693 'editingteacher' => CAP_ALLOW
697 'moodle/role:manage' => array(
699 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
701 'captype' => 'write',
702 'contextlevel' => CONTEXT_SYSTEM,
703 'archetypes' => array(
704 'manager' => CAP_ALLOW
708 'moodle/role:switchroles' => array(
710 'riskbitmask' => RISK_XSS | RISK_PERSONAL,
712 'captype' => 'read',
713 'contextlevel' => CONTEXT_COURSE,
714 'archetypes' => array(
715 'editingteacher' => CAP_ALLOW,
716 'manager' => CAP_ALLOW
720 // Create, update and delete course categories. (Deleting a course category
721 // does not let you delete the courses it contains, unless you also have
722 // moodle/course: delete.) Creating and deleting requires this permission in
723 // the parent category.
724 'moodle/category:manage' => array(
726 'riskbitmask' => RISK_XSS,
728 'captype' => 'write',
729 'contextlevel' => CONTEXT_COURSECAT,
730 'archetypes' => array(
731 'manager' => CAP_ALLOW
733 'clonepermissionsfrom' => 'moodle/category:update'
736 'moodle/category:viewhiddencategories' => array(
738 'captype' => 'read',
739 'contextlevel' => CONTEXT_COURSECAT,
740 'archetypes' => array(
741 'coursecreator' => CAP_ALLOW,
742 'manager' => CAP_ALLOW
744 'clonepermissionsfrom' => 'moodle/category:visibility'
747 // create, delete, move cohorts in system and course categories,
748 // (cohorts with component !== null can be only moved)
749 'moodle/cohort:manage' => array(
751 'captype' => 'write',
752 'contextlevel' => CONTEXT_COURSECAT,
753 'archetypes' => array(
754 'manager' => CAP_ALLOW
758 // add and remove cohort members (only for cohorts where component !== null)
759 'moodle/cohort:assign' => array(
761 'captype' => 'write',
762 'contextlevel' => CONTEXT_COURSECAT,
763 'archetypes' => array(
764 'manager' => CAP_ALLOW
768 // View visible and hidden cohorts defined in the current context.
769 'moodle/cohort:view' => array(
771 'captype' => 'read',
772 'contextlevel' => CONTEXT_COURSE,
773 'archetypes' => array(
774 'editingteacher' => CAP_ALLOW,
775 'manager' => CAP_ALLOW
779 'moodle/course:create' => array(
781 'riskbitmask' => RISK_XSS,
783 'captype' => 'write',
784 'contextlevel' => CONTEXT_COURSECAT,
785 'archetypes' => array(
786 'coursecreator' => CAP_ALLOW,
787 'manager' => CAP_ALLOW
791 'moodle/course:request' => array(
792 'captype' => 'write',
793 'contextlevel' => CONTEXT_SYSTEM,
794 'archetypes' => array(
795 'user' => CAP_ALLOW,
799 'moodle/course:delete' => array(
801 'riskbitmask' => RISK_DATALOSS,
803 'captype' => 'write',
804 'contextlevel' => CONTEXT_COURSE,
805 'archetypes' => array(
806 'manager' => CAP_ALLOW
810 'moodle/course:update' => array(
812 'riskbitmask' => RISK_XSS,
814 'captype' => 'write',
815 'contextlevel' => CONTEXT_COURSE,
816 'archetypes' => array(
817 'editingteacher' => CAP_ALLOW,
818 'manager' => CAP_ALLOW
822 'moodle/course:view' => array(
824 'captype' => 'read',
825 'contextlevel' => CONTEXT_COURSE,
826 'archetypes' => array(
827 'manager' => CAP_ALLOW,
831 /* review course enrolments - no group restrictions, it is really full access to all participants info*/
832 'moodle/course:enrolreview' => array(
834 'riskbitmask' => RISK_PERSONAL,
836 'captype' => 'read',
837 'contextlevel' => CONTEXT_COURSE,
838 'archetypes' => array(
839 'editingteacher' => CAP_ALLOW,
840 'manager' => CAP_ALLOW,
844 /* add, remove, hide enrol instances in courses */
845 'moodle/course:enrolconfig' => array(
847 'riskbitmask' => RISK_PERSONAL,
849 'captype' => 'write',
850 'contextlevel' => CONTEXT_COURSE,
851 'archetypes' => array(
852 'editingteacher' => CAP_ALLOW,
853 'manager' => CAP_ALLOW,
857 'moodle/course:reviewotherusers' => array(
859 'captype' => 'read',
860 'contextlevel' => CONTEXT_COURSE,
861 'archetypes' => array(
862 'editingteacher' => CAP_ALLOW,
863 'manager' => CAP_ALLOW,
865 'clonepermissionsfrom' => 'moodle/role:assign'
868 'moodle/course:bulkmessaging' => array(
870 'riskbitmask' => RISK_SPAM,
872 'captype' => 'write',
873 'contextlevel' => CONTEXT_COURSE,
874 'archetypes' => array(
875 'teacher' => CAP_ALLOW,
876 'editingteacher' => CAP_ALLOW,
877 'manager' => CAP_ALLOW
881 'moodle/course:viewhiddenuserfields' => array(
883 'riskbitmask' => RISK_PERSONAL,
885 'captype' => 'read',
886 'contextlevel' => CONTEXT_COURSE,
887 'archetypes' => array(
888 'teacher' => CAP_ALLOW,
889 'editingteacher' => CAP_ALLOW,
890 'manager' => CAP_ALLOW
894 'moodle/course:viewhiddencourses' => array(
896 'captype' => 'read',
897 'contextlevel' => CONTEXT_COURSE,
898 'archetypes' => array(
899 'coursecreator' => CAP_ALLOW,
900 'teacher' => CAP_ALLOW,
901 'editingteacher' => CAP_ALLOW,
902 'manager' => CAP_ALLOW
906 'moodle/course:visibility' => array(
908 'captype' => 'write',
909 'contextlevel' => CONTEXT_COURSE,
910 'archetypes' => array(
911 'editingteacher' => CAP_ALLOW,
912 'manager' => CAP_ALLOW
916 'moodle/course:managefiles' => array(
918 'riskbitmask' => RISK_XSS,
920 'captype' => 'write',
921 'contextlevel' => CONTEXT_COURSE,
922 'archetypes' => array(
923 'editingteacher' => CAP_ALLOW,
924 'manager' => CAP_ALLOW
928 'moodle/course:ignoreavailabilityrestrictions' => array(
929 'captype' => 'read',
930 'contextlevel' => CONTEXT_MODULE,
931 'archetypes' => array(
932 'manager' => CAP_ALLOW,
933 'coursecreator' => CAP_ALLOW,
934 'editingteacher' => CAP_ALLOW,
935 'teacher' => CAP_ALLOW,
937 'clonepermissionsfrom' => 'moodle/course:viewhiddenactivities'
940 'moodle/course:ignorefilesizelimits' => array(
942 'captype' => 'write',
943 'contextlevel' => CONTEXT_COURSE,
944 'archetypes' => array(
948 'moodle/course:manageactivities' => array(
950 'riskbitmask' => RISK_XSS,
952 'captype' => 'write',
953 'contextlevel' => CONTEXT_MODULE,
954 'archetypes' => array(
955 'editingteacher' => CAP_ALLOW,
956 'manager' => CAP_ALLOW
960 'moodle/course:activityvisibility' => array(
962 'captype' => 'write',
963 'contextlevel' => CONTEXT_MODULE,
964 'archetypes' => array(
965 'editingteacher' => CAP_ALLOW,
966 'manager' => CAP_ALLOW
970 'moodle/course:viewhiddenactivities' => array(
972 'captype' => 'write',
973 'contextlevel' => CONTEXT_MODULE,
974 'archetypes' => array(
975 'teacher' => CAP_ALLOW,
976 'editingteacher' => CAP_ALLOW,
977 'manager' => CAP_ALLOW
981 'moodle/course:viewparticipants' => array(
983 'captype' => 'read',
984 'contextlevel' => CONTEXT_COURSE,
985 'archetypes' => array(
986 'student' => CAP_ALLOW,
987 'teacher' => CAP_ALLOW,
988 'editingteacher' => CAP_ALLOW,
989 'manager' => CAP_ALLOW
993 'moodle/course:changefullname' => array(
995 'riskbitmask' => RISK_XSS,
997 'captype' => 'write',
998 'contextlevel' => CONTEXT_COURSE,
999 'archetypes' => array(
1000 'editingteacher' => CAP_ALLOW,
1001 'manager' => CAP_ALLOW
1003 'clonepermissionsfrom' => 'moodle/course:update'
1006 'moodle/course:changeshortname' => array(
1008 'riskbitmask' => RISK_XSS,
1010 'captype' => 'write',
1011 'contextlevel' => CONTEXT_COURSE,
1012 'archetypes' => array(
1013 'editingteacher' => CAP_ALLOW,
1014 'manager' => CAP_ALLOW
1016 'clonepermissionsfrom' => 'moodle/course:update'
1019 'moodle/course:renameroles' => array(
1020 'captype' => 'write',
1021 'contextlevel' => CONTEXT_COURSE,
1022 'archetypes' => array(
1023 'editingteacher' => CAP_ALLOW,
1024 'manager' => CAP_ALLOW
1026 'clonepermissionsfrom' => 'moodle/course:update'
1029 'moodle/course:changeidnumber' => array(
1031 'riskbitmask' => RISK_XSS,
1033 'captype' => 'write',
1034 'contextlevel' => CONTEXT_COURSE,
1035 'archetypes' => array(
1036 'editingteacher' => CAP_ALLOW,
1037 'manager' => CAP_ALLOW
1039 'clonepermissionsfrom' => 'moodle/course:update'
1041 'moodle/course:changecategory' => array(
1042 'riskbitmask' => RISK_XSS,
1044 'captype' => 'write',
1045 'contextlevel' => CONTEXT_COURSE,
1046 'archetypes' => array(
1047 'editingteacher' => CAP_ALLOW,
1048 'manager' => CAP_ALLOW
1050 'clonepermissionsfrom' => 'moodle/course:update'
1053 'moodle/course:changesummary' => array(
1054 'riskbitmask' => RISK_XSS,
1056 'captype' => 'write',
1057 'contextlevel' => CONTEXT_COURSE,
1058 'archetypes' => array(
1059 'editingteacher' => CAP_ALLOW,
1060 'manager' => CAP_ALLOW
1062 'clonepermissionsfrom' => 'moodle/course:update'
1065 'moodle/course:setforcedlanguage' => array(
1066 'captype' => 'write',
1067 'contextlevel' => CONTEXT_COURSE,
1068 'archetypes' => array(
1069 'editingteacher' => CAP_ALLOW,
1070 'manager' => CAP_ALLOW
1072 'clonepermissionsfrom' => 'moodle/course:update'
1076 'moodle/site:viewparticipants' => array(
1078 'captype' => 'read',
1079 'contextlevel' => CONTEXT_SYSTEM,
1080 'archetypes' => array(
1081 'manager' => CAP_ALLOW
1085 'moodle/course:isincompletionreports' => array(
1086 'captype' => 'read',
1087 'contextlevel' => CONTEXT_COURSE,
1088 'archetypes' => array(
1089 'student' => CAP_ALLOW,
1093 'moodle/course:viewscales' => array(
1095 'captype' => 'read',
1096 'contextlevel' => CONTEXT_COURSE,
1097 'archetypes' => array(
1098 'student' => CAP_ALLOW,
1099 'teacher' => CAP_ALLOW,
1100 'editingteacher' => CAP_ALLOW,
1101 'manager' => CAP_ALLOW
1105 'moodle/course:managescales' => array(
1107 'captype' => 'write',
1108 'contextlevel' => CONTEXT_COURSE,
1109 'archetypes' => array(
1110 'editingteacher' => CAP_ALLOW,
1111 'manager' => CAP_ALLOW
1115 'moodle/course:managegroups' => array(
1117 'captype' => 'write',
1118 'contextlevel' => CONTEXT_COURSE,
1119 'archetypes' => array(
1120 'editingteacher' => CAP_ALLOW,
1121 'manager' => CAP_ALLOW
1125 'moodle/course:reset' => array(
1127 'riskbitmask' => RISK_DATALOSS,
1129 'captype' => 'write',
1130 'contextlevel' => CONTEXT_COURSE,
1131 'archetypes' => array(
1132 'editingteacher' => CAP_ALLOW,
1133 'manager' => CAP_ALLOW
1137 'moodle/course:viewsuspendedusers' => array(
1139 'captype' => 'read',
1140 'contextlevel' => CONTEXT_SYSTEM,
1141 'archetypes' => array(
1142 'editingteacher' => CAP_ALLOW,
1143 'manager' => CAP_ALLOW
1147 'moodle/course:tag' => array(
1148 'riskbitmask' => RISK_SPAM,
1149 'captype' => 'write',
1150 'contextlevel' => CONTEXT_COURSE,
1151 'archetypes' => array(
1152 'manager' => CAP_ALLOW,
1153 'editingteacher' => CAP_ALLOW,
1155 'clonepermissionsfrom' => 'moodle/course:update'
1158 'moodle/blog:view' => array(
1160 'captype' => 'read',
1161 'contextlevel' => CONTEXT_SYSTEM,
1162 'archetypes' => array(
1163 'guest' => CAP_ALLOW,
1164 'user' => CAP_ALLOW,
1165 'student' => CAP_ALLOW,
1166 'teacher' => CAP_ALLOW,
1167 'editingteacher' => CAP_ALLOW,
1168 'manager' => CAP_ALLOW
1172 'moodle/blog:search' => array(
1173 'captype' => 'read',
1174 'contextlevel' => CONTEXT_SYSTEM,
1175 'archetypes' => array(
1176 'guest' => CAP_ALLOW,
1177 'user' => CAP_ALLOW,
1178 'student' => CAP_ALLOW,
1179 'teacher' => CAP_ALLOW,
1180 'editingteacher' => CAP_ALLOW,
1181 'manager' => CAP_ALLOW
1185 'moodle/blog:viewdrafts' => array(
1187 'riskbitmask' => RISK_PERSONAL,
1188 'captype' => 'read',
1189 'contextlevel' => CONTEXT_SYSTEM,
1190 'archetypes' => array(
1191 'manager' => CAP_ALLOW
1195 'moodle/blog:create' => array( // works in CONTEXT_SYSTEM only
1197 'riskbitmask' => RISK_SPAM,
1199 'captype' => 'write',
1200 'contextlevel' => CONTEXT_SYSTEM,
1201 'archetypes' => array(
1202 'user' => CAP_ALLOW,
1203 'manager' => CAP_ALLOW
1207 'moodle/blog:manageentries' => array(
1209 'riskbitmask' => RISK_SPAM,
1211 'captype' => 'write',
1212 'contextlevel' => CONTEXT_SYSTEM,
1213 'archetypes' => array(
1214 'teacher' => CAP_ALLOW,
1215 'editingteacher' => CAP_ALLOW,
1216 'manager' => CAP_ALLOW
1220 'moodle/blog:manageexternal' => array(
1222 'riskbitmask' => RISK_SPAM,
1224 'captype' => 'write',
1225 'contextlevel' => CONTEXT_SYSTEM,
1226 'archetypes' => array(
1227 'student' => CAP_ALLOW,
1228 'user' => CAP_ALLOW,
1229 'teacher' => CAP_ALLOW,
1230 'editingteacher' => CAP_ALLOW,
1231 'manager' => CAP_ALLOW
1235 'moodle/calendar:manageownentries' => array( // works in CONTEXT_SYSTEM only
1237 'riskbitmask' => RISK_SPAM,
1239 'captype' => 'write',
1240 'contextlevel' => CONTEXT_COURSE,
1241 'archetypes' => array(
1242 'user' => CAP_ALLOW,
1243 'manager' => CAP_ALLOW
1247 'moodle/calendar:managegroupentries' => array(
1249 'riskbitmask' => RISK_SPAM,
1251 'captype' => 'write',
1252 'contextlevel' => CONTEXT_COURSE,
1253 'archetypes' => array(
1254 'teacher' => CAP_ALLOW,
1255 'editingteacher' => CAP_ALLOW,
1256 'manager' => CAP_ALLOW
1260 'moodle/calendar:manageentries' => array(
1262 'riskbitmask' => RISK_SPAM,
1264 'captype' => 'write',
1265 'contextlevel' => CONTEXT_COURSE,
1266 'archetypes' => array(
1267 'teacher' => CAP_ALLOW,
1268 'editingteacher' => CAP_ALLOW,
1269 'manager' => CAP_ALLOW
1273 'moodle/user:editprofile' => array(
1275 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
1277 'captype' => 'write',
1278 'contextlevel' => CONTEXT_USER,
1279 'archetypes' => array(
1280 'manager' => CAP_ALLOW
1284 'moodle/user:editownprofile' => array(
1286 'riskbitmask' => RISK_SPAM,
1288 'captype' => 'write',
1289 'contextlevel' => CONTEXT_SYSTEM,
1290 'archetypes' => array(
1291 'guest' => CAP_PROHIBIT,
1292 'user' => CAP_ALLOW,
1293 'manager' => CAP_ALLOW
1297 'moodle/user:changeownpassword' => array(
1299 'captype' => 'write',
1300 'contextlevel' => CONTEXT_SYSTEM,
1301 'archetypes' => array(
1302 'guest' => CAP_PROHIBIT,
1303 'user' => CAP_ALLOW,
1304 'manager' => CAP_ALLOW
1308 // The next 3 might make no sense for some roles, e.g teacher, etc.
1309 // since the next level up is site. These are more for the parent role
1310 'moodle/user:readuserposts' => array(
1312 'captype' => 'read',
1313 'contextlevel' => CONTEXT_USER,
1314 'archetypes' => array(
1315 'student' => CAP_ALLOW,
1316 'teacher' => CAP_ALLOW,
1317 'editingteacher' => CAP_ALLOW,
1318 'manager' => CAP_ALLOW
1322 'moodle/user:readuserblogs' => array(
1324 'captype' => 'read',
1325 'contextlevel' => CONTEXT_USER,
1326 'archetypes' => array(
1327 'student' => CAP_ALLOW,
1328 'teacher' => CAP_ALLOW,
1329 'editingteacher' => CAP_ALLOW,
1330 'manager' => CAP_ALLOW
1334 // designed for parent role - not used in legacy roles
1335 'moodle/user:viewuseractivitiesreport' => array(
1336 'riskbitmask' => RISK_PERSONAL,
1338 'captype' => 'read',
1339 'contextlevel' => CONTEXT_USER,
1340 'archetypes' => array(
1344 //capabilities designed for the new message system configuration
1345 'moodle/user:editmessageprofile' => array(
1347 'riskbitmask' => RISK_SPAM,
1349 'captype' => 'write',
1350 'contextlevel' => CONTEXT_USER,
1351 'archetypes' => array(
1352 'manager' => CAP_ALLOW
1356 'moodle/user:editownmessageprofile' => array(
1358 'captype' => 'write',
1359 'contextlevel' => CONTEXT_SYSTEM,
1360 'archetypes' => array(
1361 'guest' => CAP_PROHIBIT,
1362 'user' => CAP_ALLOW,
1363 'manager' => CAP_ALLOW
1367 'moodle/question:managecategory' => array(
1368 'riskbitmask' => RISK_SPAM | RISK_XSS,
1369 'captype' => 'write',
1370 'contextlevel' => CONTEXT_COURSE,
1371 'archetypes' => array(
1372 'editingteacher' => CAP_ALLOW,
1373 'manager' => CAP_ALLOW
1377 //new in moodle 1.9
1378 'moodle/question:add' => array(
1379 'riskbitmask' => RISK_SPAM | RISK_XSS,
1380 'captype' => 'write',
1381 'contextlevel' => CONTEXT_COURSE,
1382 'archetypes' => array(
1383 'editingteacher' => CAP_ALLOW,
1384 'manager' => CAP_ALLOW
1386 'clonepermissionsfrom' => 'moodle/question:manage'
1388 'moodle/question:editmine' => array(
1389 'riskbitmask' => RISK_SPAM | RISK_XSS,
1390 'captype' => 'write',
1391 'contextlevel' => CONTEXT_COURSE,
1392 'archetypes' => array(
1393 'editingteacher' => CAP_ALLOW,
1394 'manager' => CAP_ALLOW
1396 'clonepermissionsfrom' => 'moodle/question:manage'
1398 'moodle/question:editall' => array(
1399 'riskbitmask' => RISK_SPAM | RISK_XSS,
1400 'captype' => 'write',
1401 'contextlevel' => CONTEXT_COURSE,
1402 'archetypes' => array(
1403 'editingteacher' => CAP_ALLOW,
1404 'manager' => CAP_ALLOW
1406 'clonepermissionsfrom' => 'moodle/question:manage'
1408 'moodle/question:viewmine' => array(
1409 'captype' => 'read',
1410 'contextlevel' => CONTEXT_COURSE,
1411 'archetypes' => array(
1412 'editingteacher' => CAP_ALLOW,
1413 'manager' => CAP_ALLOW
1415 'clonepermissionsfrom' => 'moodle/question:manage'
1417 'moodle/question:viewall' => array(
1418 'captype' => 'read',
1419 'contextlevel' => CONTEXT_COURSE,
1420 'archetypes' => array(
1421 'editingteacher' => CAP_ALLOW,
1422 'manager' => CAP_ALLOW
1424 'clonepermissionsfrom' => 'moodle/question:manage'
1426 'moodle/question:usemine' => array(
1427 'captype' => 'read',
1428 'contextlevel' => CONTEXT_COURSE,
1429 'archetypes' => array(
1430 'editingteacher' => CAP_ALLOW,
1431 'manager' => CAP_ALLOW
1433 'clonepermissionsfrom' => 'moodle/question:manage'
1435 'moodle/question:useall' => array(
1436 'captype' => 'read',
1437 'contextlevel' => CONTEXT_COURSE,
1438 'archetypes' => array(
1439 'editingteacher' => CAP_ALLOW,
1440 'manager' => CAP_ALLOW
1442 'clonepermissionsfrom' => 'moodle/question:manage'
1444 'moodle/question:movemine' => array(
1445 'captype' => 'write',
1446 'contextlevel' => CONTEXT_COURSE,
1447 'archetypes' => array(
1448 'editingteacher' => CAP_ALLOW,
1449 'manager' => CAP_ALLOW
1451 'clonepermissionsfrom' => 'moodle/question:manage'
1453 'moodle/question:moveall' => array(
1454 'captype' => 'write',
1455 'contextlevel' => CONTEXT_COURSE,
1456 'archetypes' => array(
1457 'editingteacher' => CAP_ALLOW,
1458 'manager' => CAP_ALLOW
1460 'clonepermissionsfrom' => 'moodle/question:manage'
1462 //END new in moodle 1.9
1464 // Configure the installed question types.
1465 'moodle/question:config' => array(
1466 'riskbitmask' => RISK_CONFIG,
1467 'captype' => 'write',
1468 'contextlevel' => CONTEXT_SYSTEM,
1469 'archetypes' => array(
1470 'manager' => CAP_ALLOW
1474 // While attempting questions, the ability to flag particular questions for later reference.
1475 'moodle/question:flag' => array(
1476 'captype' => 'write',
1477 'contextlevel' => CONTEXT_COURSE,
1478 'archetypes' => array(
1479 'student' => CAP_ALLOW,
1480 'teacher' => CAP_ALLOW,
1481 'editingteacher' => CAP_ALLOW,
1482 'manager' => CAP_ALLOW
1486 // Controls whether the user can tag his own questions.
1487 'moodle/question:tagmine' => array(
1488 'captype' => 'write',
1489 'contextlevel' => CONTEXT_COURSE,
1490 'archetypes' => array(
1491 'editingteacher' => CAP_ALLOW,
1492 'manager' => CAP_ALLOW
1494 'clonepermissionsfrom' => 'moodle/question:editmine'
1497 // Controls whether the user can tag all questions.
1498 'moodle/question:tagall' => array(
1499 'captype' => 'write',
1500 'contextlevel' => CONTEXT_COURSE,
1501 'archetypes' => array(
1502 'editingteacher' => CAP_ALLOW,
1503 'manager' => CAP_ALLOW
1505 'clonepermissionsfrom' => 'moodle/question:editall'
1508 'moodle/site:doclinks' => array(
1509 'captype' => 'read',
1510 'contextlevel' => CONTEXT_SYSTEM,
1511 'archetypes' => array(
1512 'teacher' => CAP_ALLOW,
1513 'editingteacher' => CAP_ALLOW,
1514 'manager' => CAP_ALLOW
1518 'moodle/course:sectionvisibility' => array(
1520 'captype' => 'write',
1521 'contextlevel' => CONTEXT_COURSE,
1522 'archetypes' => array(
1523 'editingteacher' => CAP_ALLOW,
1524 'manager' => CAP_ALLOW
1528 'moodle/course:useremail' => array(
1530 'captype' => 'write',
1531 'contextlevel' => CONTEXT_COURSE,
1532 'archetypes' => array(
1533 'editingteacher' => CAP_ALLOW,
1534 'manager' => CAP_ALLOW
1538 'moodle/course:viewhiddensections' => array(
1540 'captype' => 'write',
1541 'contextlevel' => CONTEXT_COURSE,
1542 'archetypes' => array(
1543 'editingteacher' => CAP_ALLOW,
1544 'manager' => CAP_ALLOW
1548 'moodle/course:setcurrentsection' => array(
1550 'captype' => 'write',
1551 'contextlevel' => CONTEXT_COURSE,
1552 'archetypes' => array(
1553 'editingteacher' => CAP_ALLOW,
1554 'manager' => CAP_ALLOW
1558 'moodle/course:movesections' => array(
1560 'captype' => 'write',
1561 'contextlevel' => CONTEXT_COURSE,
1562 'archetypes' => array(
1563 'editingteacher' => CAP_ALLOW,
1564 'manager' => CAP_ALLOW
1566 'clonepermissionsfrom' => 'moodle/course:update'
1569 'moodle/site:mnetlogintoremote' => array(
1571 'captype' => 'read',
1572 'contextlevel' => CONTEXT_SYSTEM,
1573 'archetypes' => array(
1577 'moodle/grade:viewall' => array(
1578 'riskbitmask' => RISK_PERSONAL,
1579 'captype' => 'read',
1580 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_USER
1581 'archetypes' => array(
1582 'teacher' => CAP_ALLOW,
1583 'editingteacher' => CAP_ALLOW,
1584 'manager' => CAP_ALLOW
1586 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
1589 'moodle/grade:view' => array(
1590 'captype' => 'read',
1591 'contextlevel' => CONTEXT_COURSE,
1592 'archetypes' => array(
1593 'student' => CAP_ALLOW
1597 'moodle/grade:viewhidden' => array(
1598 'riskbitmask' => RISK_PERSONAL,
1599 'captype' => 'read',
1600 'contextlevel' => CONTEXT_COURSE,
1601 'archetypes' => array(
1602 'teacher' => CAP_ALLOW,
1603 'editingteacher' => CAP_ALLOW,
1604 'manager' => CAP_ALLOW
1606 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
1609 'moodle/grade:import' => array(
1610 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
1611 'captype' => 'write',
1612 'contextlevel' => CONTEXT_COURSE,
1613 'archetypes' => array(
1614 'editingteacher' => CAP_ALLOW,
1615 'manager' => CAP_ALLOW
1617 'clonepermissionsfrom' => 'moodle/course:managegrades'
1620 'moodle/grade:export' => array(
1621 'riskbitmask' => RISK_PERSONAL,
1622 'captype' => 'read',
1623 'contextlevel' => CONTEXT_COURSE,
1624 'archetypes' => array(
1625 'teacher' => CAP_ALLOW,
1626 'editingteacher' => CAP_ALLOW,
1627 'manager' => CAP_ALLOW
1629 'clonepermissionsfrom' => 'moodle/course:managegrades'
1632 'moodle/grade:manage' => array(
1633 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
1634 'captype' => 'write',
1635 'contextlevel' => CONTEXT_COURSE,
1636 'archetypes' => array(
1637 'editingteacher' => CAP_ALLOW,
1638 'manager' => CAP_ALLOW
1640 'clonepermissionsfrom' => 'moodle/course:managegrades'
1643 'moodle/grade:edit' => array(
1644 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
1645 'captype' => 'write',
1646 'contextlevel' => CONTEXT_COURSE,
1647 'archetypes' => array(
1648 'editingteacher' => CAP_ALLOW,
1649 'manager' => CAP_ALLOW
1651 'clonepermissionsfrom' => 'moodle/course:managegrades'
1654 // ability to define advanced grading forms in activities either from scratch
1655 // or from a shared template
1656 'moodle/grade:managegradingforms' => array(
1657 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
1658 'captype' => 'write',
1659 'contextlevel' => CONTEXT_COURSE,
1660 'archetypes' => array(
1661 'editingteacher' => CAP_ALLOW,
1662 'manager' => CAP_ALLOW
1664 'clonepermissionsfrom' => 'moodle/course:managegrades'
1667 // ability to save a grading form as a new shared template and eventually edit
1668 // and remove own templates (templates originally shared by that user)
1669 'moodle/grade:sharegradingforms' => array(
1670 'riskbitmask' => RISK_XSS,
1671 'captype' => 'write',
1672 'contextlevel' => CONTEXT_SYSTEM,
1673 'archetypes' => array(
1674 'manager' => CAP_ALLOW
1678 // ability to edit and remove any shared template, even those originally shared
1679 // by other users
1680 'moodle/grade:managesharedforms' => array(
1681 'riskbitmask' => RISK_XSS,
1682 'captype' => 'write',
1683 'contextlevel' => CONTEXT_SYSTEM,
1684 'archetypes' => array(
1685 'manager' => CAP_ALLOW
1689 'moodle/grade:manageoutcomes' => array(
1690 'captype' => 'write',
1691 'contextlevel' => CONTEXT_COURSE,
1692 'archetypes' => array(
1693 'editingteacher' => CAP_ALLOW,
1694 'manager' => CAP_ALLOW
1696 'clonepermissionsfrom' => 'moodle/course:managegrades'
1699 'moodle/grade:manageletters' => array(
1700 'captype' => 'write',
1701 'contextlevel' => CONTEXT_COURSE,
1702 'archetypes' => array(
1703 'editingteacher' => CAP_ALLOW,
1704 'manager' => CAP_ALLOW
1706 'clonepermissionsfrom' => 'moodle/course:managegrades'
1709 'moodle/grade:hide' => array(
1710 'captype' => 'write',
1711 'contextlevel' => CONTEXT_COURSE,
1712 'archetypes' => array(
1713 'editingteacher' => CAP_ALLOW,
1714 'manager' => CAP_ALLOW
1718 'moodle/grade:lock' => array(
1719 'captype' => 'write',
1720 'contextlevel' => CONTEXT_COURSE,
1721 'archetypes' => array(
1722 'editingteacher' => CAP_ALLOW,
1723 'manager' => CAP_ALLOW
1727 'moodle/grade:unlock' => array(
1728 'captype' => 'write',
1729 'contextlevel' => CONTEXT_COURSE,
1730 'archetypes' => array(
1731 'editingteacher' => CAP_ALLOW,
1732 'manager' => CAP_ALLOW
1736 'moodle/my:manageblocks' => array(
1737 'captype' => 'write',
1738 'contextlevel' => CONTEXT_SYSTEM,
1739 'archetypes' => array(
1740 'user' => CAP_ALLOW
1744 'moodle/notes:view' => array(
1745 'captype' => 'read',
1746 'contextlevel' => CONTEXT_COURSE,
1747 'archetypes' => array(
1748 'teacher' => CAP_ALLOW,
1749 'editingteacher' => CAP_ALLOW,
1750 'manager' => CAP_ALLOW
1754 'moodle/notes:manage' => array(
1755 'riskbitmask' => RISK_SPAM,
1757 'captype' => 'write',
1758 'contextlevel' => CONTEXT_COURSE,
1759 'archetypes' => array(
1760 'teacher' => CAP_ALLOW,
1761 'editingteacher' => CAP_ALLOW,
1762 'manager' => CAP_ALLOW
1766 'moodle/tag:manage' => array(
1767 'riskbitmask' => RISK_SPAM,
1769 'captype' => 'write',
1770 'contextlevel' => CONTEXT_SYSTEM,
1771 'archetypes' => array(
1772 'manager' => CAP_ALLOW
1776 'moodle/tag:edit' => array(
1777 'riskbitmask' => RISK_SPAM,
1779 'captype' => 'write',
1780 'contextlevel' => CONTEXT_SYSTEM,
1781 'archetypes' => array(
1782 'manager' => CAP_ALLOW
1786 'moodle/tag:flag' => array(
1787 'riskbitmask' => RISK_SPAM,
1789 'captype' => 'write',
1790 'contextlevel' => CONTEXT_SYSTEM,
1791 'archetypes' => array(
1792 'user' => CAP_ALLOW
1796 'moodle/tag:editblocks' => array(
1797 'captype' => 'write',
1798 'contextlevel' => CONTEXT_SYSTEM,
1799 'archetypes' => array(
1800 'teacher' => CAP_ALLOW,
1801 'editingteacher' => CAP_ALLOW,
1802 'manager' => CAP_ALLOW
1806 'moodle/block:view' => array(
1807 'captype' => 'read',
1808 'contextlevel' => CONTEXT_BLOCK,
1809 'archetypes' => array(
1810 'guest' => CAP_ALLOW,
1811 'user' => CAP_ALLOW,
1812 'student' => CAP_ALLOW,
1813 'teacher' => CAP_ALLOW,
1814 'editingteacher' => CAP_ALLOW,
1818 'moodle/block:edit' => array(
1819 'riskbitmask' => RISK_SPAM | RISK_XSS,
1821 'captype' => 'write',
1822 'contextlevel' => CONTEXT_BLOCK,
1823 'archetypes' => array(
1824 'editingteacher' => CAP_ALLOW,
1825 'manager' => CAP_ALLOW
1829 'moodle/portfolio:export' => array(
1830 'captype' => 'read',
1831 'contextlevel' => CONTEXT_SYSTEM,
1832 'archetypes' => array(
1833 'user' => CAP_ALLOW,
1834 'student' => CAP_ALLOW,
1835 'teacher' => CAP_ALLOW,
1836 'editingteacher' => CAP_ALLOW,
1839 'moodle/comment:view' => array(
1840 'captype' => 'read',
1841 'contextlevel' => CONTEXT_COURSE,
1842 'archetypes' => array(
1843 'frontpage' => CAP_ALLOW,
1844 'guest' => CAP_ALLOW,
1845 'user' => CAP_ALLOW,
1846 'student' => CAP_ALLOW,
1847 'teacher' => CAP_ALLOW,
1848 'editingteacher' => CAP_ALLOW,
1849 'manager' => CAP_ALLOW
1852 'moodle/comment:post' => array(
1854 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
1855 'captype' => 'write',
1856 'contextlevel' => CONTEXT_COURSE,
1857 'archetypes' => array(
1858 'user' => CAP_ALLOW,
1859 'student' => CAP_ALLOW,
1860 'teacher' => CAP_ALLOW,
1861 'editingteacher' => CAP_ALLOW,
1862 'manager' => CAP_ALLOW
1865 'moodle/comment:delete' => array(
1867 'riskbitmask' => RISK_DATALOSS,
1868 'captype' => 'write',
1869 'contextlevel' => CONTEXT_COURSE,
1870 'archetypes' => array(
1871 'editingteacher' => CAP_ALLOW,
1872 'manager' => CAP_ALLOW
1875 'moodle/webservice:createtoken' => array(
1877 'riskbitmask' => RISK_CONFIG | RISK_DATALOSS | RISK_SPAM | RISK_PERSONAL | RISK_XSS,
1878 'captype' => 'write',
1879 'contextlevel' => CONTEXT_SYSTEM,
1880 'archetypes' => array(
1881 'manager' => CAP_ALLOW
1884 'moodle/webservice:managealltokens' => array(
1886 'riskbitmask' => RISK_CONFIG | RISK_DATALOSS | RISK_PERSONAL,
1887 'captype' => 'write',
1888 'contextlevel' => CONTEXT_SYSTEM,
1889 'archetypes' => array()
1891 'moodle/webservice:createmobiletoken' => array(
1893 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
1894 'captype' => 'write',
1895 'contextlevel' => CONTEXT_SYSTEM,
1896 'archetypes' => array(
1897 'user' => CAP_ALLOW
1900 'moodle/rating:view' => array(
1902 'captype' => 'read',
1903 'contextlevel' => CONTEXT_COURSE,
1904 'archetypes' => array(
1905 'user' => CAP_ALLOW,
1906 'student' => CAP_ALLOW,
1907 'teacher' => CAP_ALLOW,
1908 'editingteacher' => CAP_ALLOW,
1909 'manager' => CAP_ALLOW
1912 'moodle/rating:viewany' => array(
1914 'riskbitmask' => RISK_PERSONAL,
1915 'captype' => 'read',
1916 'contextlevel' => CONTEXT_COURSE,
1917 'archetypes' => array(
1918 'user' => CAP_ALLOW,
1919 'student' => CAP_ALLOW,
1920 'teacher' => CAP_ALLOW,
1921 'editingteacher' => CAP_ALLOW,
1922 'manager' => CAP_ALLOW
1925 'moodle/rating:viewall' => array(
1927 'riskbitmask' => RISK_PERSONAL,
1928 'captype' => 'read',
1929 'contextlevel' => CONTEXT_COURSE,
1930 'archetypes' => array(
1931 'user' => CAP_ALLOW,
1932 'student' => CAP_ALLOW,
1933 'teacher' => CAP_ALLOW,
1934 'editingteacher' => CAP_ALLOW,
1935 'manager' => CAP_ALLOW
1938 'moodle/rating:rate' => array(
1940 'captype' => 'write',
1941 'contextlevel' => CONTEXT_COURSE,
1942 'archetypes' => array(
1943 'user' => CAP_ALLOW,
1944 'student' => CAP_ALLOW,
1945 'teacher' => CAP_ALLOW,
1946 'editingteacher' => CAP_ALLOW,
1947 'manager' => CAP_ALLOW
1950 'moodle/course:publish' => array(
1952 'captype' => 'write',
1953 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
1954 'contextlevel' => CONTEXT_SYSTEM,
1955 'archetypes' => array(
1956 'manager' => CAP_ALLOW
1959 'moodle/course:markcomplete' => array(
1960 'captype' => 'write',
1961 'contextlevel' => CONTEXT_COURSE,
1962 'archetypes' => array(
1963 'teacher' => CAP_ALLOW,
1964 'editingteacher' => CAP_ALLOW,
1965 'manager' => CAP_ALLOW
1968 'moodle/course:overridecompletion' => array(
1969 'captype' => 'write',
1970 'contextlevel' => CONTEXT_COURSE,
1971 'archetypes' => array(
1972 'teacher' => CAP_ALLOW,
1973 'editingteacher' => CAP_ALLOW,
1974 'manager' => CAP_ALLOW
1977 'moodle/community:add' => array(
1978 'captype' => 'write',
1979 'contextlevel' => CONTEXT_SYSTEM,
1980 'archetypes' => array(
1981 'manager' => CAP_ALLOW,
1982 'teacher' => CAP_ALLOW,
1983 'editingteacher' => CAP_ALLOW,
1986 'moodle/community:download' => array(
1987 'captype' => 'write',
1988 'contextlevel' => CONTEXT_SYSTEM,
1989 'archetypes' => array(
1990 'manager' => CAP_ALLOW,
1991 'editingteacher' => CAP_ALLOW,
1995 // Badges.
1996 'moodle/badges:manageglobalsettings' => array(
1997 'riskbitmask' => RISK_DATALOSS | RISK_CONFIG,
1998 'captype' => 'write',
1999 'contextlevel' => CONTEXT_SYSTEM,
2000 'archetypes' => array(
2001 'manager' => CAP_ALLOW,
2005 // View available badges without earning them.
2006 'moodle/badges:viewbadges' => array(
2007 'captype' => 'read',
2008 'contextlevel' => CONTEXT_COURSE,
2009 'archetypes' => array(
2010 'user' => CAP_ALLOW,
2014 // Manage badges on own private badges page.
2015 'moodle/badges:manageownbadges' => array(
2016 'riskbitmap' => RISK_SPAM,
2017 'captype' => 'write',
2018 'contextlevel' => CONTEXT_USER,
2019 'archetypes' => array(
2020 'user' => CAP_ALLOW
2024 // View public badges in other users' profiles.
2025 'moodle/badges:viewotherbadges' => array(
2026 'riskbitmap' => RISK_PERSONAL,
2027 'captype' => 'read',
2028 'contextlevel' => CONTEXT_USER,
2029 'archetypes' => array(
2030 'user' => CAP_ALLOW
2034 // Earn badge.
2035 'moodle/badges:earnbadge' => array(
2036 'captype' => 'write',
2037 'contextlevel' => CONTEXT_COURSE,
2038 'archetypes' => array(
2039 'user' => CAP_ALLOW,
2043 // Create/duplicate badges.
2044 'moodle/badges:createbadge' => array(
2045 'riskbitmask' => RISK_SPAM,
2046 'captype' => 'write',
2047 'contextlevel' => CONTEXT_COURSE,
2048 'archetypes' => array(
2049 'manager' => CAP_ALLOW,
2050 'editingteacher' => CAP_ALLOW,
2054 // Delete badges.
2055 'moodle/badges:deletebadge' => array(
2056 'riskbitmask' => RISK_DATALOSS,
2057 'captype' => 'write',
2058 'contextlevel' => CONTEXT_COURSE,
2059 'archetypes' => array(
2060 'manager' => CAP_ALLOW,
2061 'editingteacher' => CAP_ALLOW,
2065 // Set up/edit badge details.
2066 'moodle/badges:configuredetails' => array(
2067 'riskbitmask' => RISK_SPAM,
2068 'captype' => 'write',
2069 'contextlevel' => CONTEXT_COURSE,
2070 'archetypes' => array(
2071 'manager' => CAP_ALLOW,
2072 'editingteacher' => CAP_ALLOW,
2076 // Set up/edit criteria of earning a badge.
2077 'moodle/badges:configurecriteria' => array(
2078 'riskbitmask' => RISK_XSS,
2079 'captype' => 'write',
2080 'contextlevel' => CONTEXT_COURSE,
2081 'archetypes' => array(
2082 'manager' => CAP_ALLOW,
2083 'editingteacher' => CAP_ALLOW,
2087 // Configure badge messages.
2088 'moodle/badges:configuremessages' => array(
2089 'riskbitmask' => RISK_SPAM,
2090 'captype' => 'write',
2091 'contextlevel' => CONTEXT_COURSE,
2092 'archetypes' => array(
2093 'manager' => CAP_ALLOW,
2094 'editingteacher' => CAP_ALLOW,
2098 // Award badge to a user.
2099 'moodle/badges:awardbadge' => array(
2100 'riskbitmask' => RISK_SPAM,
2101 'captype' => 'write',
2102 'contextlevel' => CONTEXT_COURSE,
2103 'archetypes' => array(
2104 'manager' => CAP_ALLOW,
2105 'teacher' => CAP_ALLOW,
2106 'editingteacher' => CAP_ALLOW,
2110 // Revoke badge from a user.
2111 'moodle/badges:revokebadge' => array(
2112 'riskbitmask' => RISK_SPAM,
2113 'captype' => 'write',
2114 'contextlevel' => CONTEXT_COURSE,
2115 'archetypes' => array(
2116 'manager' => CAP_ALLOW,
2117 'teacher' => CAP_ALLOW,
2118 'editingteacher' => CAP_ALLOW,
2122 // View users who earned a specific badge without being able to award a badge.
2123 'moodle/badges:viewawarded' => array(
2124 'riskbitmask' => RISK_PERSONAL,
2125 'captype' => 'read',
2126 'contextlevel' => CONTEXT_COURSE,
2127 'archetypes' => array(
2128 'manager' => CAP_ALLOW,
2129 'teacher' => CAP_ALLOW,
2130 'editingteacher' => CAP_ALLOW,
2134 'moodle/site:forcelanguage' => array(
2135 'captype' => 'read',
2136 'contextlevel' => CONTEXT_SYSTEM,
2137 'archetypes' => array(
2141 // Perform site-wide search queries through the search API.
2142 'moodle/search:query' => array(
2143 'captype' => 'read',
2144 'contextlevel' => CONTEXT_SYSTEM,
2145 'archetypes' => array(
2146 'guest' => CAP_ALLOW,
2147 'user' => CAP_ALLOW,
2148 'student' => CAP_ALLOW,
2149 'teacher' => CAP_ALLOW,
2150 'editingteacher' => CAP_ALLOW,
2151 'manager' => CAP_ALLOW
2155 // Competencies.
2156 'moodle/competency:competencymanage' => array(
2157 'captype' => 'write',
2158 'contextlevel' => CONTEXT_COURSECAT,
2159 'archetypes' => array(
2160 'manager' => CAP_ALLOW
2163 'moodle/competency:competencyview' => array(
2164 'captype' => 'read',
2165 'contextlevel' => CONTEXT_COURSECAT,
2166 'archetypes' => array(
2167 'user' => CAP_ALLOW
2170 'moodle/competency:competencygrade' => array(
2171 'captype' => 'write',
2172 'contextlevel' => CONTEXT_COURSE, // And CONTEXT_USER.
2173 'archetypes' => array(
2174 'editingteacher' => CAP_ALLOW,
2175 'teacher' => CAP_ALLOW,
2176 'manager' => CAP_ALLOW
2179 // Course competencies.
2180 'moodle/competency:coursecompetencymanage' => array(
2181 'captype' => 'write',
2182 'contextlevel' => CONTEXT_COURSE,
2183 'archetypes' => array(
2184 'editingteacher' => CAP_ALLOW,
2185 'manager' => CAP_ALLOW
2188 'moodle/competency:coursecompetencyconfigure' => array(
2189 'captype' => 'write',
2190 'contextlevel' => CONTEXT_MODULE,
2191 'archetypes' => array(
2192 'manager' => CAP_ALLOW
2195 'moodle/competency:coursecompetencygradable' => array(
2196 'captype' => 'read',
2197 'contextlevel' => CONTEXT_COURSE,
2198 'archetypes' => array(
2199 'student' => CAP_ALLOW
2201 'clonepermissionsfrom' => 'moodle/course:isincompletionreports'
2203 'moodle/competency:coursecompetencyview' => array(
2204 'captype' => 'read',
2205 'contextlevel' => CONTEXT_COURSE,
2206 'archetypes' => array(
2207 'user' => CAP_ALLOW
2210 // Evidence.
2211 'moodle/competency:evidencedelete' => array(
2212 'captype' => 'write',
2213 'contextlevel' => CONTEXT_USER,
2214 'archetypes' => array(
2216 'clonepermissionsfrom' => 'moodle/site:config'
2218 // User plans.
2219 'moodle/competency:planmanage' => array(
2220 'captype' => 'write',
2221 'contextlevel' => CONTEXT_USER,
2222 'archetypes' => array(
2223 'manager' => CAP_ALLOW
2226 'moodle/competency:planmanagedraft' => array(
2227 'captype' => 'write',
2228 'contextlevel' => CONTEXT_USER,
2229 'archetypes' => array(
2230 'manager' => CAP_ALLOW
2233 'moodle/competency:planmanageown' => array(
2234 'captype' => 'write',
2235 'contextlevel' => CONTEXT_USER,
2236 'archetypes' => array(
2239 'moodle/competency:planmanageowndraft' => array(
2240 'captype' => 'write',
2241 'contextlevel' => CONTEXT_USER,
2242 'archetypes' => array(
2245 'moodle/competency:planview' => array(
2246 'captype' => 'read',
2247 'contextlevel' => CONTEXT_USER,
2248 'archetypes' => array(
2249 'manager' => CAP_ALLOW
2252 'moodle/competency:planviewdraft' => array(
2253 'captype' => 'read',
2254 'contextlevel' => CONTEXT_USER,
2255 'archetypes' => array(
2256 'manager' => CAP_ALLOW
2259 'moodle/competency:planviewown' => array(
2260 'captype' => 'read',
2261 'contextlevel' => CONTEXT_USER,
2262 'archetypes' => array(
2263 'user' => CAP_ALLOW
2266 'moodle/competency:planviewowndraft' => array(
2267 'captype' => 'read',
2268 'contextlevel' => CONTEXT_USER,
2269 'archetypes' => array(
2272 'moodle/competency:planrequestreview' => array(
2273 'captype' => 'write',
2274 'contextlevel' => CONTEXT_USER,
2275 'archetypes' => array(
2276 'manager' => CAP_ALLOW
2279 'moodle/competency:planrequestreviewown' => array(
2280 'captype' => 'write',
2281 'contextlevel' => CONTEXT_USER,
2282 'archetypes' => array(
2283 'user' => CAP_ALLOW
2286 'moodle/competency:planreview' => array(
2287 'captype' => 'write',
2288 'contextlevel' => CONTEXT_USER,
2289 'archetypes' => array(
2290 'manager' => CAP_ALLOW
2293 'moodle/competency:plancomment' => array(
2294 'captype' => 'write',
2295 'contextlevel' => CONTEXT_USER,
2296 'archetypes' => array(
2297 'manager' => CAP_ALLOW
2300 'moodle/competency:plancommentown' => array(
2301 'captype' => 'write',
2302 'contextlevel' => CONTEXT_USER,
2303 'archetypes' => array(
2304 'user' => CAP_ALLOW
2307 // User competencies.
2308 'moodle/competency:usercompetencyview' => array(
2309 'captype' => 'read',
2310 'contextlevel' => CONTEXT_USER, // And CONTEXT_COURSE.
2311 'archetypes' => array(
2312 'manager' => CAP_ALLOW,
2313 'editingteacher' => CAP_ALLOW,
2314 'teacher' => CAP_ALLOW
2317 'moodle/competency:usercompetencyrequestreview' => array(
2318 'captype' => 'write',
2319 'contextlevel' => CONTEXT_USER,
2320 'archetypes' => array(
2321 'manager' => CAP_ALLOW
2324 'moodle/competency:usercompetencyrequestreviewown' => array(
2325 'captype' => 'write',
2326 'contextlevel' => CONTEXT_USER,
2327 'archetypes' => array(
2328 'user' => CAP_ALLOW
2331 'moodle/competency:usercompetencyreview' => array(
2332 'captype' => 'write',
2333 'contextlevel' => CONTEXT_USER,
2334 'archetypes' => array(
2335 'manager' => CAP_ALLOW
2338 'moodle/competency:usercompetencycomment' => array(
2339 'captype' => 'write',
2340 'contextlevel' => CONTEXT_USER,
2341 'archetypes' => array(
2342 'manager' => CAP_ALLOW
2345 'moodle/competency:usercompetencycommentown' => array(
2346 'captype' => 'write',
2347 'contextlevel' => CONTEXT_USER,
2348 'archetypes' => array(
2349 'user' => CAP_ALLOW
2352 // Template.
2353 'moodle/competency:templatemanage' => array(
2354 'captype' => 'write',
2355 'contextlevel' => CONTEXT_COURSECAT,
2356 'archetypes' => array(
2357 'manager' => CAP_ALLOW
2360 'moodle/analytics:listinsights' => array(
2361 'riskbitmask' => RISK_PERSONAL,
2362 'captype' => 'read',
2363 'contextlevel' => CONTEXT_COURSE,
2364 'archetypes' => array(
2365 'teacher' => CAP_ALLOW,
2366 'editingteacher' => CAP_ALLOW,
2367 'manager' => CAP_ALLOW
2370 'moodle/analytics:managemodels' => array(
2371 'riskbitmask' => RISK_CONFIG,
2372 'captype' => 'write',
2373 'contextlevel' => CONTEXT_SYSTEM,
2374 'archetypes' => array(
2375 'manager' => CAP_ALLOW
2378 'moodle/competency:templateview' => array(
2379 'captype' => 'read',
2380 'contextlevel' => CONTEXT_COURSECAT,
2381 'archetypes' => array(
2382 'manager' => CAP_ALLOW
2385 // User evidence.
2386 'moodle/competency:userevidencemanage' => array(
2387 'captype' => 'write',
2388 'contextlevel' => CONTEXT_USER,
2389 'archetypes' => array(
2390 'manager' => CAP_ALLOW
2393 'moodle/competency:userevidencemanageown' => array(
2394 'captype' => 'write',
2395 'contextlevel' => CONTEXT_USER,
2396 'archetypes' => array(
2397 'user' => CAP_ALLOW
2400 'moodle/competency:userevidenceview' => array(
2401 'captype' => 'read',
2402 'contextlevel' => CONTEXT_USER,
2403 'archetypes' => array(
2404 'manager' => CAP_ALLOW
2407 'moodle/site:maintenanceaccess' => array(
2408 'captype' => 'write',
2409 'contextlevel' => CONTEXT_SYSTEM,
2410 'archetypes' => array(