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