Converted deprecated get_teacher() to use new tables
[moodle.git] / lib / db / access.php
CommitLineData
bbbf2d40 1<?php
2//
3// Capability definitions for Moodle core.
4//
5// The capabilities are loaded into the database table when the module is
6// installed or updated. Whenever the capability definitions are updated,
7// the module version number should be bumped up.
8//
9// The system has four possible values for a capability:
10// CAP_ALLOW, CAP_PREVENT, CAP_PROHIBIT, and inherit (not set).
11//
12//
13// CAPABILITY NAMING CONVENTION
14//
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>
18//
19// component_name should be the same as the directory name of the mod or block.
20//
21// Core moodle capabilities are defined thus:
22// moodle/<capabilityclass>:<capabilityname>
23//
24// Examples: mod/forum:viewpost
25// block/recent_activity:view
26// moodle/site:deleteuser
27//
28// The variable name for the capability definitions array follows the format
29// $<componenttype>_<component_name>_capabilities
30//
31// For the core capabilities, the variable is $moodle_capabilities.
32
33
34$moodle_capabilities = array(
35
36 'moodle/site:doanything' => array(
37 'captype' => 'admin',
38 'contextlevel' => CONTEXT_SYSTEM
39 ),
40
41 'moodle/legacy:guest' => array(
42 'captype' => 'legacy',
43 'contextlevel' => CONTEXT_SYSTEM
44 ),
45
46
47 'moodle/legacy:student' => array(
48 'captype' => 'legacy',
49 'contextlevel' => CONTEXT_SYSTEM
50 ),
51
52
53 'moodle/legacy:teacher' => array(
54 'captype' => 'legacy',
55 'contextlevel' => CONTEXT_SYSTEM
56 ),
57
58
59 'moodle/legacy:editingteacher' => array(
60 'captype' => 'legacy',
61 'contextlevel' => CONTEXT_SYSTEM
62 ),
63
64
65 'moodle/legacy:coursecreator' => array(
66 'captype' => 'legacy',
67 'contextlevel' => CONTEXT_SYSTEM
68 ),
69
70
71 'moodle/legacy:admin' => array(
72 'captype' => 'legacy',
73 'contextlevel' => CONTEXT_SYSTEM
74 ),
75
76
77 'moodle/site:config' => array(
78
79 'captype' => 'write',
80 'contextlevel' => CONTEXT_SYSTEM,
81 'legacy' => array(
82 'guest' => CAP_PREVENT,
83 'student' => CAP_PREVENT,
84 'teacher' => CAP_PREVENT,
85 'editingteacher' => CAP_PREVENT,
86 'coursecreator' => CAP_PREVENT,
87 'admin' => CAP_ALLOW
88 )
89 ),
90
51792df0 91 'moodle/site:readallmessages' => array(
92
93 'captype' => 'read',
94 'contextlevel' => CONTEXT_SYSTEM,
95 'legacy' => array(
96 'guest' => CAP_PREVENT,
97 'student' => CAP_PREVENT,
98 'teacher' => CAP_PREVENT,
99 'editingteacher' => CAP_PREVENT,
100 'coursecreator' => CAP_PREVENT,
101 'admin' => CAP_ALLOW
102 )
103 ),
104
105 'moodle/site:approvecourse' => array(
106
107 'captype' => 'write',
108 'contextlevel' => CONTEXT_SYSTEM,
109 'legacy' => array(
110 'guest' => CAP_PREVENT,
111 'student' => CAP_PREVENT,
112 'teacher' => CAP_PREVENT,
113 'editingteacher' => CAP_PREVENT,
114 'coursecreator' => CAP_PREVENT,
115 'admin' => CAP_ALLOW
116 )
117 ),
118
bbbf2d40 119 'moodle/site:import' => array(
120
121 'captype' => 'write',
122 'contextlevel' => CONTEXT_SYSTEM,
123 'legacy' => array(
124 'guest' => CAP_PREVENT,
125 'student' => CAP_PREVENT,
a028c291 126 'teacher' => CAP_ALLOW,
127 'editingteacher' => CAP_ALLOW,
128 'coursecreator' => CAP_ALLOW,
bbbf2d40 129 'admin' => CAP_ALLOW
130 )
131 ),
132
133 'moodle/site:backup' => array(
134
135 'captype' => 'write',
136 'contextlevel' => CONTEXT_SYSTEM,
137 'legacy' => array(
138 'guest' => CAP_PREVENT,
139 'student' => CAP_PREVENT,
140 'teacher' => CAP_PREVENT,
141 'editingteacher' => CAP_PREVENT,
142 'coursecreator' => CAP_PREVENT,
143 'admin' => CAP_ALLOW
144 )
145 ),
146
147 'moodle/site:restore' => array(
148
149 'captype' => 'write',
150 'contextlevel' => CONTEXT_SYSTEM,
151 'legacy' => array(
152 'guest' => CAP_PREVENT,
153 'student' => CAP_PREVENT,
154 'teacher' => CAP_PREVENT,
155 'editingteacher' => CAP_PREVENT,
156 'coursecreator' => CAP_PREVENT,
157 'admin' => CAP_ALLOW
158 )
159 ),
160
161 'moodle/site:manageblocks' => array(
162
163 'captype' => 'write',
164 'contextlevel' => CONTEXT_SYSTEM,
165 'legacy' => array(
166 'guest' => CAP_PREVENT,
167 'student' => CAP_PREVENT,
168 'teacher' => CAP_PREVENT,
73b73d21 169 'editingteacher' => CAP_ALLOW,
170 'coursecreator' => CAP_ALLOW,
bbbf2d40 171 'admin' => CAP_ALLOW
172 )
173 ),
174
27950688 175 'moodle/site:accessallgroups' => array(
176
177 'captype' => 'read',
178 'contextlevel' => CONTEXT_SYSTEM,
179 'legacy' => array(
180 'guest' => CAP_PREVENT,
181 'student' => CAP_PREVENT,
182 'teacher' => CAP_ALLOW,
183 'editingteacher' => CAP_ALLOW,
184 'coursecreator' => CAP_ALLOW,
185 'admin' => CAP_ALLOW
186 )
187 ),
188
53d7785b 189 'moodle/site:viewfullnames' => array(
190
191 'captype' => 'read',
192 'contextlevel' => CONTEXT_SYSTEM,
193 'legacy' => array(
194 'guest' => CAP_PREVENT,
195 'student' => CAP_PREVENT,
196 'teacher' => CAP_ALLOW,
197 'editingteacher' => CAP_ALLOW,
198 'coursecreator' => CAP_ALLOW,
199 'admin' => CAP_ALLOW
200 )
201 ),
202
a028c291 203 'moodle/site:viewreports' => array(
204
205 'captype' => 'read',
77d4953e 206 'contextlevel' => CONTEXT_SYSTEM,
a028c291 207 'legacy' => array(
208 'guest' => CAP_PREVENT,
209 'student' => CAP_PREVENT,
210 'teacher' => CAP_ALLOW,
211 'editingteacher' => CAP_ALLOW,
212 'coursecreator' => CAP_ALLOW,
213 'admin' => CAP_ALLOW
214 )
215 ),
216
7d8a3cb0 217 'moodle/site:trustcontent' => array(
218
219 'captype' => 'write',
220 'contextlevel' => CONTEXT_SYSTEM,
221 'legacy' => array(
222 'guest' => CAP_PREVENT,
223 'student' => CAP_PREVENT,
224 'teacher' => CAP_PREVENT,
225 'editingteacher' => CAP_ALLOW,
226 'coursecreator' => CAP_ALLOW,
227 'admin' => CAP_ALLOW
228 )
229 ),
230
bbbf2d40 231 'moodle/user:create' => array(
232
233 'captype' => 'write',
234 'contextlevel' => CONTEXT_SYSTEM,
235 'legacy' => array(
236 'guest' => CAP_PREVENT,
237 'student' => CAP_PREVENT,
238 'teacher' => CAP_PREVENT,
239 'editingteacher' => CAP_PREVENT,
240 'coursecreator' => CAP_PREVENT,
241 'admin' => CAP_ALLOW
242 )
243 ),
244
245 'moodle/user:delete' => array(
246
247 'captype' => 'write',
248 'contextlevel' => CONTEXT_SYSTEM,
249 'legacy' => array(
250 'guest' => CAP_PREVENT,
251 'student' => CAP_PREVENT,
252 'teacher' => CAP_PREVENT,
253 'editingteacher' => CAP_PREVENT,
254 'coursecreator' => CAP_PREVENT,
255 'admin' => CAP_ALLOW
256 )
257 ),
258
259 'moodle/user:update' => array(
260
261 'captype' => 'write',
262 'contextlevel' => CONTEXT_SYSTEM,
263 'legacy' => array(
264 'guest' => CAP_PREVENT,
265 'student' => CAP_PREVENT,
266 'teacher' => CAP_PREVENT,
267 'editingteacher' => CAP_PREVENT,
268 'coursecreator' => CAP_PREVENT,
269 'admin' => CAP_ALLOW
270 )
271 ),
272
273 'moodle/user:viewdetails' => array(
274
e58eca72 275 'captype' => 'read',
bbbf2d40 276 'contextlevel' => CONTEXT_SYSTEM,
277 'legacy' => array(
278 'guest' => CAP_PREVENT,
279 'student' => CAP_ALLOW,
280 'teacher' => CAP_ALLOW,
281 'editingteacher' => CAP_ALLOW,
282 'coursecreator' => CAP_ALLOW,
283 'admin' => CAP_ALLOW
284 )
285 ),
e58eca72 286
287 'moodle/user:viewhiddendetails' => array(
288
289 'captype' => 'read',
290 'contextlevel' => CONTEXT_SYSTEM,
291 'legacy' => array(
292 'guest' => CAP_PREVENT,
293 'student' => CAP_PREVENT,
294 'teacher' => CAP_ALLOW,
295 'editingteacher' => CAP_ALLOW,
296 'coursecreator' => CAP_ALLOW,
297 'admin' => CAP_ALLOW
298 )
299 ),
bbbf2d40 300
301 'moodle/role:assign' => array(
302
303 'captype' => 'write',
304 'contextlevel' => CONTEXT_SYSTEM,
305 'legacy' => array(
306 'guest' => CAP_PREVENT,
68c52526 307 'student' => CAP_PREVENT,
308 'teacher' => CAP_PREVENT,
309 'editingteacher' => CAP_PREVENT,
310 'coursecreator' => CAP_PREVENT,
311 'admin' => CAP_ALLOW
312 )
313 ),
314
315 'moodle/role:override' => array(
316
317 'captype' => 'write',
318 'contextlevel' => CONTEXT_SYSTEM,
319 'legacy' => array(
320 'guest' => CAP_PREVENT,
bbbf2d40 321 'student' => CAP_PREVENT,
322 'teacher' => CAP_PREVENT,
323 'editingteacher' => CAP_PREVENT,
324 'coursecreator' => CAP_PREVENT,
325 'admin' => CAP_ALLOW
326 )
327 ),
328
329 'moodle/role:manage' => array(
330
331 'captype' => 'write',
332 'contextlevel' => CONTEXT_SYSTEM,
333 'legacy' => array(
334 'guest' => CAP_PREVENT,
335 'student' => CAP_PREVENT,
336 'teacher' => CAP_PREVENT,
337 'editingteacher' => CAP_PREVENT,
338 'coursecreator' => CAP_PREVENT,
339 'admin' => CAP_ALLOW
340 )
341 ),
f43ce1ad 342
343 'moodle/role:unassignself' => array(
344 'captype' => 'write',
345 'contextlevel' => CONTEXT_SYSTEM,
346 'legacy' => array(
347 'guest' => CAP_PREVENT,
348 'student' => (empty($CFG->allowunenrol)) ? CAP_PREVENT : CAP_ALLOW,
349 'teacher' => CAP_ALLOW,
350 'editingteacher' => CAP_ALLOW,
351 'coursecreator' => CAP_ALLOW,
352 'admin' => CAP_ALLOW
353 )
354 ),
bbbf2d40 355
356 'moodle/category:create' => array(
357
358 'captype' => 'write',
359 'contextlevel' => CONTEXT_COURSECAT,
360 'legacy' => array(
361 'guest' => CAP_PREVENT,
362 'student' => CAP_PREVENT,
363 'teacher' => CAP_PREVENT,
364 'editingteacher' => CAP_PREVENT,
365 'coursecreator' => CAP_PREVENT,
366 'admin' => CAP_ALLOW
367 )
368 ),
369
370 'moodle/category:delete' => array(
371
372 'captype' => 'write',
373 'contextlevel' => CONTEXT_COURSECAT,
374 'legacy' => array(
375 'guest' => CAP_PREVENT,
376 'student' => CAP_PREVENT,
377 'teacher' => CAP_PREVENT,
378 'editingteacher' => CAP_PREVENT,
379 'coursecreator' => CAP_PREVENT,
380 'admin' => CAP_ALLOW
381 )
382 ),
383
384 'moodle/category:update' => array(
385
386 'captype' => 'write',
387 'contextlevel' => CONTEXT_COURSECAT,
388 'legacy' => array(
389 'guest' => CAP_PREVENT,
390 'student' => CAP_PREVENT,
391 'teacher' => CAP_PREVENT,
392 'editingteacher' => CAP_PREVENT,
393 'coursecreator' => CAP_PREVENT,
394 'admin' => CAP_ALLOW
395 )
396 ),
397
398 'moodle/category:visibility' => array(
399
400 'captype' => 'write',
401 'contextlevel' => CONTEXT_COURSECAT,
402 'legacy' => array(
403 'guest' => CAP_PREVENT,
404 'student' => CAP_PREVENT,
405 'teacher' => CAP_PREVENT,
406 'editingteacher' => CAP_PREVENT,
407 'coursecreator' => CAP_PREVENT,
408 'admin' => CAP_ALLOW
409 )
410 ),
411
412 'moodle/course:create' => array(
413
414 'captype' => 'write',
415 'contextlevel' => CONTEXT_COURSE,
416 'legacy' => array(
417 'guest' => CAP_PREVENT,
418 'student' => CAP_PREVENT,
419 'teacher' => CAP_PREVENT,
420 'editingteacher' => CAP_PREVENT,
421 'coursecreator' => CAP_PREVENT,
422 'admin' => CAP_ALLOW
423 )
424 ),
425
426 'moodle/course:delete' => array(
427
428 'captype' => 'write',
429 'contextlevel' => CONTEXT_COURSE,
430 'legacy' => array(
431 'guest' => CAP_PREVENT,
432 'student' => CAP_PREVENT,
433 'teacher' => CAP_PREVENT,
434 'editingteacher' => CAP_PREVENT,
435 'coursecreator' => CAP_PREVENT,
436 'admin' => CAP_ALLOW
437 )
438 ),
439
440 'moodle/course:update' => array(
441
442 'captype' => 'write',
443 'contextlevel' => CONTEXT_COURSE,
444 'legacy' => array(
445 'guest' => CAP_PREVENT,
446 'student' => CAP_PREVENT,
447 'teacher' => CAP_PREVENT,
448 'editingteacher' => CAP_ALLOW,
449 'coursecreator' => CAP_ALLOW,
450 'admin' => CAP_ALLOW
451 )
452 ),
453
454 'moodle/course:view' => array(
455
456 'captype' => 'read',
457 'contextlevel' => CONTEXT_COURSE,
458 'legacy' => array(
b0f55230 459 'guest' => CAP_ALLOW,
bbbf2d40 460 'student' => CAP_ALLOW,
461 'teacher' => CAP_ALLOW,
462 'editingteacher' => CAP_ALLOW,
463 'coursecreator' => CAP_ALLOW,
464 'admin' => CAP_ALLOW
465 )
466 ),
467
1c45e42e 468 'moodle/course:viewhiddenuserfields' => array(
469
470 'captype' => 'read',
471 'contextlevel' => CONTEXT_COURSE,
472 'legacy' => array(
473 'guest' => CAP_PREVENT,
474 'student' => CAP_PREVENT,
475 'teacher' => CAP_ALLOW,
476 'editingteacher' => CAP_ALLOW,
477 'coursecreator' => CAP_ALLOW,
478 'admin' => CAP_ALLOW
479 )
480 ),
481
482 'moodle/course:viewhiddencourses' => array(
483
484 'captype' => 'read',
485 'contextlevel' => CONTEXT_COURSE,
486 'legacy' => array(
487 'guest' => CAP_PREVENT,
488 'student' => CAP_PREVENT,
489 'teacher' => CAP_PREVENT,
490 'editingteacher' => CAP_PREVENT,
491 'coursecreator' => CAP_ALLOW,
492 'admin' => CAP_ALLOW
493 )
494 ),
495
bbbf2d40 496 'moodle/course:visibility' => array(
497
498 'captype' => 'write',
499 'contextlevel' => CONTEXT_COURSE,
500 'legacy' => array(
501 'guest' => CAP_PREVENT,
502 'student' => CAP_PREVENT,
503 'teacher' => CAP_PREVENT,
504 'editingteacher' => CAP_PREVENT,
505 'coursecreator' => CAP_ALLOW,
506 'admin' => CAP_ALLOW
507 )
508 ),
509
a028c291 510 'moodle/course:managefiles' => array(
511
512 'captype' => 'write',
513 'contextlevel' => CONTEXT_COURSE,
514 'legacy' => array(
515 'guest' => CAP_PREVENT,
516 'student' => CAP_PREVENT,
517 'teacher' => CAP_PREVENT,
518 'editingteacher' => CAP_ALLOW,
519 'coursecreator' => CAP_ALLOW,
520 'admin' => CAP_ALLOW
521 )
522 ),
523
524 'moodle/course:managequestions' => array(
525
526 'captype' => 'write',
527 'contextlevel' => CONTEXT_COURSE,
528 'legacy' => array(
529 'guest' => CAP_PREVENT,
530 'student' => CAP_PREVENT,
531 'teacher' => CAP_ALLOW,
532 'editingteacher' => CAP_ALLOW,
533 'coursecreator' => CAP_ALLOW,
534 'admin' => CAP_ALLOW
535 )
536 ),
537
bbbf2d40 538 'moodle/course:manageactivities' => array(
539
540 'captype' => 'write',
541 'contextlevel' => CONTEXT_COURSE,
542 'legacy' => array(
543 'guest' => CAP_PREVENT,
544 'student' => CAP_PREVENT,
545 'teacher' => CAP_ALLOW,
546 'editingteacher' => CAP_ALLOW,
547 'coursecreator' => CAP_ALLOW,
548 'admin' => CAP_ALLOW
549 )
550 ),
551
552 'moodle/course:activityvisibility' => array(
553
554 'captype' => 'write',
555 'contextlevel' => CONTEXT_COURSE,
556 'legacy' => array(
557 'guest' => CAP_PREVENT,
558 'student' => CAP_PREVENT,
559 'teacher' => CAP_PREVENT,
560 'editingteacher' => CAP_ALLOW,
561 'coursecreator' => CAP_ALLOW,
562 'admin' => CAP_ALLOW
563 )
564 ),
565
566 'moodle/course:viewhiddenactivities' => array(
567
568 'captype' => 'write',
569 'contextlevel' => CONTEXT_COURSE,
570 'legacy' => array(
571 'guest' => CAP_PREVENT,
572 'student' => CAP_PREVENT,
573 'teacher' => CAP_ALLOW,
574 'editingteacher' => CAP_ALLOW,
575 'coursecreator' => CAP_ALLOW,
576 'admin' => CAP_ALLOW
577 )
578 ),
579
580 'moodle/course:viewparticipants' => array(
581
582 'captype' => 'read',
583 'contextlevel' => CONTEXT_COURSE,
584 'legacy' => array(
585 'guest' => CAP_PREVENT,
586 'student' => CAP_ALLOW,
587 'teacher' => CAP_ALLOW,
588 'editingteacher' => CAP_ALLOW,
589 'coursecreator' => CAP_ALLOW,
590 'admin' => CAP_ALLOW
591 )
592 ),
593
594 'moodle/course:viewscales' => array(
595
596 'captype' => 'read',
597 'contextlevel' => CONTEXT_COURSE,
598 'legacy' => array(
599 'guest' => CAP_PREVENT,
600 'student' => CAP_ALLOW,
601 'teacher' => CAP_ALLOW,
602 'editingteacher' => CAP_ALLOW,
603 'coursecreator' => CAP_ALLOW,
604 'admin' => CAP_ALLOW
605 )
606 ),
607
608 'moodle/course:managescales' => array(
609
610 'captype' => 'write',
611 'contextlevel' => CONTEXT_COURSE,
612 'legacy' => array(
613 'guest' => CAP_PREVENT,
614 'student' => CAP_PREVENT,
615 'teacher' => CAP_PREVENT,
616 'editingteacher' => CAP_ALLOW,
617 'coursecreator' => CAP_ALLOW,
618 'admin' => CAP_ALLOW
619 )
620 ),
621
622 'moodle/course:managegroups' => array(
623
624 'captype' => 'write',
625 'contextlevel' => CONTEXT_COURSE,
a028c291 626 'legacy' => array(
627 'guest' => CAP_PREVENT,
628 'student' => CAP_PREVENT,
629 'teacher' => CAP_PREVENT,
630 'editingteacher' => CAP_ALLOW,
631 'coursecreator' => CAP_ALLOW,
632 'admin' => CAP_ALLOW
633 )
634 ),
635
636 'moodle/course:reset' => array(
637
638 'captype' => 'write',
639 'contextlevel' => CONTEXT_COURSE,
bbbf2d40 640 'legacy' => array(
641 'guest' => CAP_PREVENT,
642 'student' => CAP_PREVENT,
643 'teacher' => CAP_PREVENT,
644 'editingteacher' => CAP_ALLOW,
645 'coursecreator' => CAP_ALLOW,
646 'admin' => CAP_ALLOW
647 )
648 ),
649
650 'moodle/blog:view' => array(
651
652 'captype' => 'read',
653 'contextlevel' => CONTEXT_SYSTEM,
654 'legacy' => array(
00adf177 655 'guest' => CAP_ALLOW,
bbbf2d40 656 'student' => CAP_ALLOW,
657 'teacher' => CAP_ALLOW,
658 'editingteacher' => CAP_ALLOW,
659 'coursecreator' => CAP_ALLOW,
660 'admin' => CAP_ALLOW
661 )
662 ),
663
664 'moodle/blog:create' => array(
665
666 'captype' => 'write',
667 'contextlevel' => CONTEXT_SYSTEM,
668 'legacy' => array(
669 'guest' => CAP_PREVENT,
670 'student' => CAP_ALLOW,
671 'teacher' => CAP_ALLOW,
672 'editingteacher' => CAP_ALLOW,
673 'coursecreator' => CAP_ALLOW,
674 'admin' => CAP_ALLOW
675 )
676 ),
677
678 'moodle/blog:manageofficialtags' => array(
679
680 'captype' => 'write',
681 'contextlevel' => CONTEXT_SYSTEM,
682 'legacy' => array(
683 'guest' => CAP_PREVENT,
684 'student' => CAP_PREVENT,
685 'teacher' => CAP_PREVENT,
686 'editingteacher' => CAP_PREVENT,
687 'coursecreator' => CAP_PREVENT,
688 'admin' => CAP_ALLOW
689 )
690 ),
691
692 'moodle/blog:managepersonaltags' => array(
693
694 'captype' => 'write',
695 'contextlevel' => CONTEXT_SYSTEM,
696 'legacy' => array(
697 'guest' => CAP_PREVENT,
698 'student' => CAP_ALLOW,
699 'teacher' => CAP_ALLOW,
700 'editingteacher' => CAP_ALLOW,
701 'coursecreator' => CAP_ALLOW,
702 'admin' => CAP_ALLOW
703 )
704 ),
705
706 'moodle/blog:manageentries' => array(
707
708 'captype' => 'write',
709 'contextlevel' => CONTEXT_SYSTEM,
710 'legacy' => array(
711 'guest' => CAP_PREVENT,
712 'student' => CAP_PREVENT,
713 'teacher' => CAP_ALLOW,
714 'editingteacher' => CAP_ALLOW,
715 'coursecreator' => CAP_ALLOW,
716 'admin' => CAP_ALLOW
717 )
718 ),
719
720 'moodle/calendar:manageownentries' => array(
721
722 'captype' => 'write',
723 'contextlevel' => CONTEXT_SYSTEM,
724 'legacy' => array(
725 'guest' => CAP_PREVENT,
726 'student' => CAP_ALLOW,
727 'teacher' => CAP_ALLOW,
728 'editingteacher' => CAP_ALLOW,
729 'coursecreator' => CAP_ALLOW,
730 'admin' => CAP_ALLOW
731 )
732 ),
733
734 'moodle/calendar:manageentries' => array(
735
736 'captype' => 'write',
737 'contextlevel' => CONTEXT_SYSTEM,
738 'legacy' => array(
739 'guest' => CAP_PREVENT,
740 'student' => CAP_PREVENT,
741 'teacher' => CAP_ALLOW,
742 'editingteacher' => CAP_ALLOW,
743 'coursecreator' => CAP_ALLOW,
744 'admin' => CAP_ALLOW
745 )
77d4953e 746 ),
747
748 // The next 3 might make no sense for some roles, e.g teacher, etc.
749 // since the next level up is site. These are more for the parent role
750 'moodle/user:readuserposts' => array(
751 'captype' => 'read',
4b10f08b 752 'contextlevel' => CONTEXT_USER,
77d4953e 753 'legacy' => array(
754 'guest' => CAP_PREVENT,
755 'student' => CAP_ALLOW,
756 'teacher' => CAP_ALLOW,
757 'editingteacher' => CAP_ALLOW,
758 'coursecreator' => CAP_ALLOW,
759 'admin' => CAP_ALLOW
760 )
761 ),
bbbf2d40 762
77d4953e 763 'moodle/user:readuserblogs' => array(
764 'captype' => 'read',
4b10f08b 765 'contextlevel' => CONTEXT_USER,
77d4953e 766 'legacy' => array(
767 'guest' => CAP_PREVENT,
768 'student' => CAP_ALLOW,
769 'teacher' => CAP_ALLOW,
770 'editingteacher' => CAP_ALLOW,
771 'coursecreator' => CAP_ALLOW,
772 'admin' => CAP_ALLOW
773 )
774 ),
775
776 'moodle/user:viewuseractivitiesreport' => array(
777 'captype' => 'read',
4b10f08b 778 'contextlevel' => CONTEXT_USER,
77d4953e 779 'legacy' => array(
780 'guest' => CAP_PREVENT,
781 'student' => CAP_PREVENT,
782 'teacher' => CAP_ALLOW,
783 'editingteacher' => CAP_ALLOW,
784 'coursecreator' => CAP_ALLOW,
785 'admin' => CAP_ALLOW
786 )
945f88ca 787 ),
788
ec7a8b79 789 'moodle/user:editprofile' => array(
790 'captype' => 'read',
4b10f08b 791 'contextlevel' => CONTEXT_USER,
ec7a8b79 792 'legacy' => array(
793 'guest' => CAP_PREVENT,
794 'student' => CAP_PREVENT,
795 'teacher' => CAP_PREVENT,
796 'editingteacher' => CAP_PREVENT,
797 'coursecreator' => CAP_PREVENT,
798 'admin' => CAP_ALLOW
799 )
800 ),
801
945f88ca 802 'moodle/question:import' => array(
803 'captype' => 'write',
804 'contextlevel' => CONTEXT_COURSE,
805 'legacy' => array(
806 'guest' => CAP_PREVENT,
807 'student' => CAP_PREVENT,
808 'teacher' => CAP_PREVENT,
809 'editingteacher' => CAP_ALLOW,
810 'coursecreator' => CAP_ALLOW,
811 'admin' => CAP_ALLOW
812 )
813 ),
814
815 'moodle/question:export' => array(
816 'captype' => 'read',
817 'contextlevel' => CONTEXT_COURSE,
818 'legacy' => array(
819 'guest' => CAP_PREVENT,
820 'student' => CAP_PREVENT,
821 'teacher' => CAP_PREVENT,
822 'editingteacher' => CAP_ALLOW,
823 'coursecreator' => CAP_ALLOW,
824 'admin' => CAP_ALLOW
825 )
826 ),
827
f43ce1ad 828 'moodle/question:managecategory' => array(
945f88ca 829 'captype' => 'write',
830 'contextlevel' => CONTEXT_COURSE,
831 'legacy' => array(
832 'guest' => CAP_PREVENT,
833 'student' => CAP_PREVENT,
834 'teacher' => CAP_PREVENT,
835 'editingteacher' => CAP_ALLOW,
836 'coursecreator' => CAP_ALLOW,
837 'admin' => CAP_ALLOW
838 )
839 ),
840
841 'moodle/question:manage' => array(
842 'captype' => 'write',
843 'contextlevel' => CONTEXT_COURSE,
844 'legacy' => array(
845 'guest' => CAP_PREVENT,
846 'student' => CAP_PREVENT,
847 'teacher' => CAP_PREVENT,
848 'editingteacher' => CAP_ALLOW,
849 'coursecreator' => CAP_ALLOW,
850 'admin' => CAP_ALLOW
851 )
7191a1fa 852 ),
853
854 'moodle/site:doclinks' => array(
855 'captype' => 'read',
856 'contextlevel' => CONTEXT_SYSTEM,
857 'legacy' => array(
858 'guest' => CAP_PREVENT,
859 'student' => CAP_PREVENT,
860 'teacher' => CAP_ALLOW,
861 'editingteacher' => CAP_ALLOW,
862 'coursecreator' => CAP_ALLOW,
863 'admin' => CAP_ALLOW
864 )
3924b988 865 ),
866
867 'moodle/course:sectionvisibility' => array(
868 'captype' => 'write',
869 'contextlevel' => CONTEXT_COURSE,
870 'legacy' => array(
871 'guest' => CAP_PREVENT,
872 'student' => CAP_PREVENT,
873 'teacher' => CAP_PREVENT,
874 'editingteacher' => CAP_ALLOW,
875 'coursecreator' => CAP_ALLOW,
876 'admin' => CAP_ALLOW
877 )
878 ),
879
880 'moodle/course:viewhiddensections' => array(
881 'captype' => 'write',
882 'contextlevel' => CONTEXT_COURSE,
883 'legacy' => array(
884 'guest' => CAP_PREVENT,
885 'student' => CAP_PREVENT,
886 'teacher' => CAP_PREVENT,
887 'editingteacher' => CAP_ALLOW,
888 'coursecreator' => CAP_ALLOW,
889 'admin' => CAP_ALLOW
890 )
891 ),
892
893 'moodle/course:setcurrentsection' => array(
894 'captype' => 'write',
895 'contextlevel' => CONTEXT_COURSE,
896 'legacy' => array(
897 'guest' => CAP_PREVENT,
898 'student' => CAP_PREVENT,
899 'teacher' => CAP_PREVENT,
900 'editingteacher' => CAP_ALLOW,
901 'coursecreator' => CAP_ALLOW,
902 'admin' => CAP_ALLOW
903 )
904 ),
905
906 'moodle/course:viewcoursegrades' => array(
907 'captype' => 'read',
908 'contextlevel' => CONTEXT_COURSE,
909 'legacy' => array(
910 'guest' => CAP_PREVENT,
911 'student' => CAP_PREVENT,
912 'teacher' => CAP_ALLOW,
913 'editingteacher' => CAP_ALLOW,
914 'coursecreator' => CAP_ALLOW,
915 'admin' => CAP_ALLOW
916 )
917 ),
918
919 'moodle/course:managegrades' => array(
920 'captype' => 'write',
921 'contextlevel' => CONTEXT_COURSE,
922 'legacy' => array(
923 'guest' => CAP_PREVENT,
924 'student' => CAP_PREVENT,
925 'teacher' => CAP_PREVENT,
926 'editingteacher' => CAP_ALLOW,
927 'coursecreator' => CAP_ALLOW,
928 'admin' => CAP_ALLOW
929 )
930 ),
931
932 'moodle/user:viewusergrades' => array(
933 'captype' => 'write',
934 'contextlevel' => CONTEXT_COURSE,
935 'legacy' => array(
936 'guest' => CAP_PREVENT,
937 'student' => CAP_ALLOW,
938 'teacher' => CAP_ALLOW,
939 'editingteacher' => CAP_ALLOW,
940 'coursecreator' => CAP_ALLOW,
941 'admin' => CAP_ALLOW
942 )
77d4953e 943 )
f43ce1ad 944
bbbf2d40 945);
946
947?>