Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 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.
13
//
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/>.
16
 
17
/**
18
 * Capability definitions for Moodle core.
19
 *
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.
23
 *
24
 * The system has four possible values for a capability:
25
 * CAP_ALLOW, CAP_PREVENT, CAP_PROHIBIT, and inherit (not set).
26
 *
27
 *
28
 * CAPABILITY NAMING CONVENTION
29
 *
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>
33
 *
34
 * component_name should be the same as the directory name of the mod or block.
35
 *
36
 * Core moodle capabilities are defined thus:
37
 *    moodle/<capabilityclass>:<capabilityname>
38
 *
39
 * Examples: mod/forum:viewpost
40
 *           block/recent_activity:view
41
 *           moodle/site:deleteuser
42
 *
43
 * The variable name for the capability definitions array is $capabilities
44
 *
45
 * For more information, take a look to the documentation available:
46
 *     - Access API: {@link https://moodledev.io/docs/apis/subsystems/access}
47
 *     - Upgrade API: {@link https://moodledev.io/docs/guides/upgrade}
48
 *
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
53
 */
54
 
55
defined('MOODLE_INTERNAL') || die();
56
 
57
$capabilities = array(
58
    'moodle/site:config' => array(
59
 
60
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG | RISK_DATALOSS,
61
 
62
        'captype' => 'write',
63
        'contextlevel' => CONTEXT_SYSTEM,
64
        'archetypes' => array(
65
        )
66
    ),
67
    'moodle/site:configview' => array(
68
        'captype' => 'read',
69
        'contextlevel' => CONTEXT_SYSTEM,
70
        'archetypes' => array(
71
            'manager' => CAP_ALLOW,
72
            'coursecreator' => CAP_ALLOW,
73
        )
74
    ),
75
 
76
    'moodle/site:readallmessages' => array(
77
 
78
        'riskbitmask' => RISK_PERSONAL,
79
 
80
        'captype' => 'read',
81
        'contextlevel' => CONTEXT_SYSTEM,
82
        'archetypes' => array(
83
            'manager' => CAP_ALLOW,
84
            'editingteacher' => CAP_ALLOW
85
        )
86
    ),
87
 
88
    'moodle/site:manageallmessaging' => array(
89
 
90
        'riskbitmask' => RISK_PERSONAL,
91
 
92
        'captype' => 'write',
93
        'contextlevel' => CONTEXT_SYSTEM,
94
        'archetypes' => array(
95
            'manager' => CAP_ALLOW
96
        )
97
    ),
98
 
99
    'moodle/site:deleteanymessage' => array(
100
 
101
        'riskbitmask' => RISK_DATALOSS,
102
 
103
        'captype' => 'write',
104
        'contextlevel' => CONTEXT_SYSTEM,
105
        'archetypes' => array(
106
            'manager' => CAP_ALLOW
107
        )
108
    ),
109
 
110
    'moodle/site:sendmessage' => array(
111
 
112
        'riskbitmask' => RISK_SPAM,
113
 
114
        'captype' => 'write',
115
        'contextlevel' => CONTEXT_SYSTEM,
116
        'archetypes' => array(
117
            'manager' => CAP_ALLOW,
118
            'user' => CAP_ALLOW
119
        )
120
    ),
121
 
122
    'moodle/site:senderrormessage' => [
123
        'riskbitmask' => RISK_SPAM,
124
        'captype' => 'write',
125
        'contextlevel' => CONTEXT_SYSTEM,
126
        'archetypes' => array(
127
            'user' => CAP_ALLOW
128
        )
129
    ],
130
 
131
    'moodle/site:deleteownmessage' => array(
132
 
133
        'captype' => 'write',
134
        'contextlevel' => CONTEXT_SYSTEM,
135
        'archetypes' => array(
136
            'user' => CAP_ALLOW
137
        )
138
    ),
139
 
140
    'moodle/site:approvecourse' => array(
141
 
142
        'riskbitmask' => RISK_XSS,
143
 
144
        'captype' => 'write',
145
        'contextlevel' => CONTEXT_COURSECAT,
146
        'archetypes' => array(
147
            'manager' => CAP_ALLOW
148
        )
149
    ),
150
 
151
    'moodle/backup:backupcourse' => array(
152
 
153
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
154
 
155
        'captype' => 'write',
156
        'contextlevel' => CONTEXT_COURSE,
157
        'archetypes' => array(
158
            'editingteacher' => CAP_ALLOW,
159
            'manager' => CAP_ALLOW
160
        ),
161
 
162
        'clonepermissionsfrom' =>  'moodle/site:backup'
163
    ),
164
 
165
    'moodle/backup:backupsection' => array(
166
 
167
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
168
 
169
        'captype' => 'write',
170
        'contextlevel' => CONTEXT_COURSE,
171
        'archetypes' => array(
172
            'editingteacher' => CAP_ALLOW,
173
            'manager' => CAP_ALLOW
174
        ),
175
 
176
        'clonepermissionsfrom' =>  'moodle/backup:backupcourse'
177
    ),
178
 
179
    'moodle/backup:backupactivity' => array(
180
 
181
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
182
 
183
        'captype' => 'write',
184
        'contextlevel' => CONTEXT_MODULE,
185
        'archetypes' => array(
186
            'editingteacher' => CAP_ALLOW,
187
            'manager' => CAP_ALLOW
188
        ),
189
 
190
        'clonepermissionsfrom' =>  'moodle/backup:backupcourse'
191
    ),
192
 
193
    'moodle/backup:backuptargetimport' => array(
194
 
195
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
196
 
197
        'captype' => 'read',
198
        'contextlevel' => CONTEXT_COURSE,
199
        'archetypes' => array(
200
            'editingteacher' => CAP_ALLOW,
201
            'manager' => CAP_ALLOW
202
        ),
203
 
204
        'clonepermissionsfrom' =>  'moodle/backup:backupcourse'
205
    ),
206
 
207
    'moodle/backup:downloadfile' => array(
208
 
209
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
210
 
211
        'captype' => 'write',
212
        'contextlevel' => CONTEXT_COURSE,
213
        'archetypes' => array(
214
            'editingteacher' => CAP_ALLOW,
215
            'manager' => CAP_ALLOW
216
        ),
217
 
218
        'clonepermissionsfrom' =>  'moodle/site:backupdownload'
219
    ),
220
 
221
    'moodle/backup:configure' => array(
222
 
223
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
224
 
225
        'captype' => 'write',
226
        'contextlevel' => CONTEXT_COURSE,
227
        'archetypes' => array(
228
            'editingteacher' => CAP_ALLOW,
229
            'manager' => CAP_ALLOW
230
        )
231
    ),
232
 
233
    'moodle/backup:userinfo' => array(
234
 
235
        'riskbitmask' => RISK_PERSONAL,
236
 
237
        'captype' => 'read',
238
        'contextlevel' => CONTEXT_COURSE,
239
        'archetypes' => array(
240
            'manager' => CAP_ALLOW
241
        )
242
    ),
243
 
244
    'moodle/backup:anonymise' => array(
245
 
246
        'riskbitmask' => RISK_PERSONAL,
247
 
248
        'captype' => 'read',
249
        'contextlevel' => CONTEXT_COURSE,
250
        'archetypes' => array(
251
            'manager' => CAP_ALLOW
252
        )
253
    ),
254
 
255
    'moodle/restore:restorecourse' => array(
256
 
257
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
258
 
259
        'captype' => 'write',
260
        'contextlevel' => CONTEXT_COURSE,
261
        'archetypes' => array(
262
            'editingteacher' => CAP_ALLOW,
263
            'manager' => CAP_ALLOW
264
        ),
265
 
266
        'clonepermissionsfrom' =>  'moodle/site:restore'
267
    ),
268
 
269
    'moodle/restore:restoresection' => array(
270
 
271
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
272
 
273
        'captype' => 'write',
274
        'contextlevel' => CONTEXT_COURSE,
275
        'archetypes' => array(
276
            'editingteacher' => CAP_ALLOW,
277
            'manager' => CAP_ALLOW
278
        ),
279
 
280
        'clonepermissionsfrom' =>  'moodle/restore:restorecourse'
281
    ),
282
 
283
    'moodle/restore:restoreactivity' => array(
284
 
285
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
286
 
287
        'captype' => 'write',
288
        'contextlevel' => CONTEXT_COURSE,
289
        'archetypes' => array(
290
            'editingteacher' => CAP_ALLOW,
291
            'manager' => CAP_ALLOW
292
        ),
293
 
294
        'clonepermissionsfrom' =>  'moodle/restore:restorecourse'
295
    ),
296
 
297
    'moodle/restore:viewautomatedfilearea' => array(
298
 
299
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
300
 
301
        'captype' => 'write',
302
        'contextlevel' => CONTEXT_COURSE,
303
        'archetypes' => array(
304
            'editingteacher' => CAP_ALLOW,
305
            'manager' => CAP_ALLOW
306
        ),
307
    ),
308
 
309
    'moodle/restore:restoretargetimport' => array(
310
 
311
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
312
 
313
        'captype' => 'write',
314
        'contextlevel' => CONTEXT_COURSE,
315
        'archetypes' => array(
316
            'editingteacher' => CAP_ALLOW,
317
            'manager' => CAP_ALLOW
318
        ),
319
 
320
        'clonepermissionsfrom' =>  'moodle/site:import'
321
    ),
322
 
323
    'moodle/restore:uploadfile' => array(
324
 
325
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
326
 
327
        'captype' => 'write',
328
        'contextlevel' => CONTEXT_COURSE,
329
        'archetypes' => array(
330
            'editingteacher' => CAP_ALLOW,
331
            'manager' => CAP_ALLOW
332
        ),
333
 
334
        'clonepermissionsfrom' =>  'moodle/site:backupupload'
335
    ),
336
 
337
    'moodle/restore:configure' => array(
338
 
339
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
340
 
341
        'captype' => 'write',
342
        'contextlevel' => CONTEXT_COURSE,
343
        'archetypes' => array(
344
            'editingteacher' => CAP_ALLOW,
345
            'manager' => CAP_ALLOW
346
        )
347
    ),
348
 
349
    'moodle/restore:rolldates' => array(
350
 
351
        'captype' => 'write',
352
        'contextlevel' => CONTEXT_COURSE,
353
        'archetypes' => array(
354
            'coursecreator' => CAP_ALLOW,
355
            'manager' => CAP_ALLOW
356
        )
357
    ),
358
 
359
    'moodle/restore:userinfo' => array(
360
 
361
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
362
 
363
        'captype' => 'write',
364
        'contextlevel' => CONTEXT_COURSE,
365
        'archetypes' => array(
366
            'manager' => CAP_ALLOW
367
        )
368
    ),
369
 
370
    'moodle/restore:createuser' => array(
371
 
372
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
373
 
374
        'captype' => 'write',
375
        'contextlevel' => CONTEXT_SYSTEM,
376
        'archetypes' => array(
377
            'manager' => CAP_ALLOW
378
        )
379
    ),
380
 
381
    'moodle/site:manageblocks' => array(
382
 
383
        'riskbitmask' => RISK_SPAM | RISK_XSS,
384
 
385
        'captype' => 'write',
386
        'contextlevel' => CONTEXT_BLOCK,
387
        'archetypes' => array(
388
            'editingteacher' => CAP_ALLOW,
389
            'manager' => CAP_ALLOW
390
        )
391
    ),
392
 
393
    'moodle/site:accessallgroups' => array(
394
 
395
        'captype' => 'read',
396
        'contextlevel' => CONTEXT_MODULE,
397
        'archetypes' => array(
398
            'editingteacher' => CAP_ALLOW,
399
            'manager' => CAP_ALLOW
400
        )
401
    ),
402
 
403
    'moodle/site:viewanonymousevents' => array(
404
 
405
        'riskbitmask' => RISK_PERSONAL,
406
 
407
        'captype' => 'read',
408
        'contextlevel' => CONTEXT_MODULE,
409
        'archetypes' => array(
410
            'manager' => CAP_ALLOW,
411
        )
412
    ),
413
 
414
    'moodle/site:viewfullnames' => array(
415
 
416
        'captype' => 'read',
417
        'contextlevel' => CONTEXT_MODULE,
418
        'archetypes' => array(
419
            'teacher' => CAP_ALLOW,
420
            'editingteacher' => CAP_ALLOW,
421
            'manager' => CAP_ALLOW
422
        )
423
    ),
424
 
425
    // In reports that give lists of users, extra information about each user's
426
    // identity (the fields configured in site option showuseridentity) will be
427
    // displayed to users who have this capability.
428
    'moodle/site:viewuseridentity' => array(
429
 
430
        'captype' => 'read',
431
        'contextlevel' => CONTEXT_MODULE,
432
        'archetypes' => array(
433
            'teacher' => CAP_ALLOW,
434
            'editingteacher' => CAP_ALLOW,
435
            'manager' => CAP_ALLOW
436
        )
437
    ),
438
 
439
    'moodle/site:viewreports' => array(
440
 
441
        'riskbitmask' => RISK_PERSONAL,
442
 
443
        'captype' => 'read',
444
        'contextlevel' => CONTEXT_COURSE,
445
        'archetypes' => array(
446
            'teacher' => CAP_ALLOW,
447
            'editingteacher' => CAP_ALLOW,
448
            'manager' => CAP_ALLOW
449
        )
450
    ),
451
 
452
    'moodle/site:trustcontent' => array(
453
 
454
        'riskbitmask' => RISK_XSS,
455
 
456
        'captype' => 'write',
457
        'contextlevel' => CONTEXT_MODULE,
458
        'archetypes' => array(
459
            'editingteacher' => CAP_ALLOW,
460
            'manager' => CAP_ALLOW
461
        )
462
    ),
463
 
464
    'moodle/site:uploadusers' => array(
465
 
466
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
467
 
468
        'captype' => 'write',
469
        'contextlevel' => CONTEXT_SYSTEM,
470
        'archetypes' => array(
471
            'manager' => CAP_ALLOW
472
        )
473
    ),
474
 
475
    // Permission to manage filter setting overrides in subcontexts.
476
    'moodle/filter:manage' => array(
477
 
478
        'captype' => 'write',
479
        'contextlevel' => CONTEXT_COURSE,
480
        'archetypes' => array(
481
            'editingteacher' => CAP_ALLOW,
482
            'manager' => CAP_ALLOW,
483
        )
484
    ),
485
 
486
    'moodle/user:create' => array(
487
 
488
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
489
 
490
        'captype' => 'write',
491
        'contextlevel' => CONTEXT_SYSTEM,
492
        'archetypes' => array(
493
            'manager' => CAP_ALLOW
494
        )
495
    ),
496
 
497
    'moodle/user:delete' => array(
498
 
499
        'riskbitmask' => RISK_PERSONAL | RISK_DATALOSS,
500
 
501
        'captype' => 'write',
502
        'contextlevel' => CONTEXT_SYSTEM,
503
        'archetypes' => array(
504
            'manager' => CAP_ALLOW
505
        )
506
    ),
507
 
508
    'moodle/user:update' => array(
509
 
510
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
511
 
512
        'captype' => 'write',
513
        'contextlevel' => CONTEXT_SYSTEM,
514
        'archetypes' => array(
515
            'manager' => CAP_ALLOW
516
        )
517
    ),
518
 
519
    'moodle/user:viewdetails' => array(
520
 
521
        'captype' => 'read',
522
        'contextlevel' => CONTEXT_COURSE,
523
        'archetypes' => array(
524
            'guest' => CAP_ALLOW,
525
            'student' => CAP_ALLOW,
526
            'teacher' => CAP_ALLOW,
527
            'editingteacher' => CAP_ALLOW,
528
            'manager' => CAP_ALLOW
529
        )
530
    ),
531
 
1441 ariadna 532
    'moodle/user:viewprofilepictures' => [
533
        'captype' => 'read',
534
        'contextlevel' => CONTEXT_SYSTEM,
535
        'archetypes' => [
536
            'guest' => CAP_ALLOW,
537
            'user' => CAP_ALLOW,
538
        ],
539
    ],
540
 
1 efrain 541
    'moodle/user:viewalldetails' => array(
542
        'riskbitmask' => RISK_PERSONAL,
543
        'captype' => 'read',
544
        'contextlevel' => CONTEXT_USER,
545
        'archetypes' => array(
546
            'manager' => CAP_ALLOW
547
        ),
548
        'clonepermissionsfrom' => 'moodle/user:update'
549
    ),
550
 
551
    'moodle/user:viewlastip' => array(
552
        'riskbitmask' => RISK_PERSONAL,
553
        'captype' => 'read',
554
        'contextlevel' => CONTEXT_USER,
555
        'archetypes' => array(
556
            'manager' => CAP_ALLOW
557
        ),
558
        'clonepermissionsfrom' => 'moodle/user:update'
559
    ),
560
 
561
    'moodle/user:viewhiddendetails' => array(
562
 
563
        'riskbitmask' => RISK_PERSONAL,
564
 
565
        'captype' => 'read',
566
        'contextlevel' => CONTEXT_COURSE,
567
        'archetypes' => array(
568
            'teacher' => CAP_ALLOW,
569
            'editingteacher' => CAP_ALLOW,
570
            'manager' => CAP_ALLOW
571
        )
572
    ),
573
 
574
    'moodle/user:loginas' => array(
575
 
576
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
577
 
578
        'captype' => 'write',
579
        'contextlevel' => CONTEXT_COURSE,
580
        'archetypes' => array(
581
            'manager' => CAP_ALLOW
582
        )
583
    ),
584
 
585
    // can the user manage the system default profile page?
586
    'moodle/user:managesyspages' => array(
587
 
588
        'riskbitmap' => RISK_SPAM | RISK_PERSONAL | RISK_CONFIG,
589
 
590
        'captype' => 'write',
591
        'contextlevel' => CONTEXT_SYSTEM,
592
        'archetypes' => array(
593
            'manager' => CAP_ALLOW
594
        )
595
    ),
596
 
597
    // can the user manage another user's profile page?
598
    'moodle/user:manageblocks' => array(
599
 
600
        'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
601
 
602
        'captype' => 'write',
603
        'contextlevel' => CONTEXT_USER
604
    ),
605
 
606
    // can the user manage their own profile page?
607
    'moodle/user:manageownblocks' => array(
608
 
609
        'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
610
 
611
        'captype' => 'write',
612
        'contextlevel' => CONTEXT_SYSTEM,
613
        'archetypes' => array(
614
            'user' => CAP_ALLOW
615
        )
616
    ),
617
 
618
    // can the user manage their own files?
619
    'moodle/user:manageownfiles' => array(
620
 
621
        'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
622
 
623
        'captype' => 'write',
624
        'contextlevel' => CONTEXT_SYSTEM,
625
        'archetypes' => array(
626
            'user' => CAP_ALLOW
627
        )
628
    ),
629
 
630
    // Can the user ignore the setting userquota?
631
    // The permissions are cloned from ignorefilesizelimits as it was partly used for that purpose.
632
    'moodle/user:ignoreuserquota' => array(
633
        'riskbitmap' => RISK_SPAM,
634
        'captype' => 'write',
635
        'contextlevel' => CONTEXT_SYSTEM,
636
        'clonepermissionsfrom' => 'moodle/course:ignorefilesizelimits'
637
    ),
638
 
639
    // can the user manage the system default dashboard page?
640
    'moodle/my:configsyspages' => array(
641
 
642
        'riskbitmap' => RISK_SPAM | RISK_PERSONAL | RISK_CONFIG,
643
 
644
        'captype' => 'write',
645
        'contextlevel' => CONTEXT_SYSTEM,
646
        'archetypes' => array(
647
            'manager' => CAP_ALLOW
648
        )
649
    ),
650
 
651
    'moodle/role:assign' => array(
652
 
653
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
654
 
655
        'captype' => 'write',
656
        'contextlevel' => CONTEXT_COURSE,
657
        'archetypes' => array(
658
            'editingteacher' => CAP_ALLOW,
659
            'manager' => CAP_ALLOW
660
        )
661
    ),
662
 
663
    'moodle/role:review' => array(
664
 
665
        'riskbitmask' => RISK_PERSONAL,
666
 
667
        'captype' => 'read',
668
        'contextlevel' => CONTEXT_COURSE,
669
        'archetypes' => array(
670
            'teacher' => CAP_ALLOW,
671
            'editingteacher' => CAP_ALLOW,
672
            'manager' => CAP_ALLOW
673
        )
674
    ),
675
 
676
    // The ability to override the permissions for any capability.
677
    'moodle/role:override' => array(
678
 
679
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
680
 
681
        'captype' => 'write',
682
        'contextlevel' => CONTEXT_COURSE,
683
        'archetypes' => array(
684
            'manager' => CAP_ALLOW
685
        )
686
    ),
687
 
688
    // The ability to override the permissions for 'safe' capabilities (those without risks).
689
    // If a user has moodle/role:override then you should not check this capability.
690
    'moodle/role:safeoverride' => array(
691
 
692
        'riskbitmask' => RISK_SPAM,
693
 
694
        'captype' => 'write',
695
        'contextlevel' => CONTEXT_COURSE,
696
        'archetypes' => array(
697
            'editingteacher' => CAP_ALLOW
698
        )
699
    ),
700
 
701
    'moodle/role:manage' => array(
702
 
703
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
704
 
705
        'captype' => 'write',
706
        'contextlevel' => CONTEXT_SYSTEM,
707
        'archetypes' => array(
708
            'manager' => CAP_ALLOW
709
        )
710
    ),
711
 
712
    'moodle/role:switchroles' => array(
713
 
714
        'riskbitmask' => RISK_XSS | RISK_PERSONAL,
715
 
716
        'captype' => 'read',
717
        'contextlevel' => CONTEXT_COURSE,
718
        'archetypes' => array(
719
            'editingteacher' => CAP_ALLOW,
720
            'manager' => CAP_ALLOW
721
        )
722
    ),
723
 
724
    // Create, update and delete course categories. (Deleting a course category
725
    // does not let you delete the courses it contains, unless you also have
726
    // moodle/course: delete.) Creating and deleting requires this permission in
727
    // the parent category.
728
    'moodle/category:manage' => array(
729
 
730
        'riskbitmask' => RISK_XSS,
731
 
732
        'captype' => 'write',
733
        'contextlevel' => CONTEXT_COURSECAT,
734
        'archetypes' => array(
735
            'manager' => CAP_ALLOW
736
        ),
737
        'clonepermissionsfrom' => 'moodle/category:update'
738
    ),
739
 
740
    'moodle/category:viewcourselist' => array(
741
 
742
        'captype' => 'read',
743
        'contextlevel' => CONTEXT_COURSECAT,
744
        'archetypes' => array(
745
            'guest' => CAP_ALLOW,
746
            'user' => CAP_ALLOW,
747
        )
748
    ),
749
 
750
    'moodle/category:viewhiddencategories' => array(
751
 
752
        'captype' => 'read',
753
        'contextlevel' => CONTEXT_COURSECAT,
754
        'archetypes' => array(
755
            'coursecreator' => CAP_ALLOW,
756
            'manager' => CAP_ALLOW
757
        ),
758
        'clonepermissionsfrom' => 'moodle/category:visibility'
759
    ),
760
 
761
    // create, delete, move cohorts in system and course categories,
762
    // (cohorts with component !== null can be only moved)
763
    'moodle/cohort:manage' => array(
764
 
765
        'captype' => 'write',
766
        'contextlevel' => CONTEXT_COURSECAT,
767
        'archetypes' => array(
768
            'manager' => CAP_ALLOW
769
        )
770
    ),
771
 
772
    // add and remove cohort members (only for cohorts where component !== null)
773
    'moodle/cohort:assign' => array(
774
 
775
        'captype' => 'write',
776
        'contextlevel' => CONTEXT_COURSECAT,
777
        'archetypes' => array(
778
            'manager' => CAP_ALLOW
779
        )
780
    ),
781
 
782
    // View visible and hidden cohorts defined in the current context.
783
    'moodle/cohort:view' => array(
784
 
785
        'captype' => 'read',
786
        'contextlevel' => CONTEXT_COURSE,
787
        'archetypes' => array(
788
            'editingteacher' => CAP_ALLOW,
789
            'manager' => CAP_ALLOW
790
        )
791
    ),
792
 
793
    'moodle/cohort:configurecustomfields' => array(
794
        'riskbitmask' => RISK_SPAM,
795
        'captype' => 'write',
796
        'contextlevel' => CONTEXT_SYSTEM,
797
        'clonepermissionsfrom' => 'moodle/site:config'
798
    ),
799
 
800
    'moodle/group:configurecustomfields' => array(
801
        'riskbitmask' => RISK_SPAM,
802
        'captype' => 'write',
803
        'contextlevel' => CONTEXT_SYSTEM,
804
        'clonepermissionsfrom' => 'moodle/site:config'
805
    ),
806
 
807
    'moodle/course:create' => array(
808
 
809
        'riskbitmask' => RISK_XSS,
810
 
811
        'captype' => 'write',
812
        'contextlevel' => CONTEXT_COURSECAT,
813
        'archetypes' => array(
814
            'coursecreator' => CAP_ALLOW,
815
            'manager' => CAP_ALLOW
816
        )
817
    ),
818
 
819
    'moodle/course:creategroupconversations' => array(
820
        'riskbitmask' => RISK_XSS,
821
        'captype' => 'write',
822
        'contextlevel' => CONTEXT_COURSE,
823
        'archetypes' => array(
824
            'editingteacher' => CAP_ALLOW,
825
            'manager' => CAP_ALLOW
826
        )
827
    ),
828
 
829
    'moodle/course:request' => array(
830
        'captype' => 'write',
831
        'contextlevel' => CONTEXT_COURSECAT,
832
    ),
833
 
834
    'moodle/course:delete' => array(
835
 
836
        'riskbitmask' => RISK_DATALOSS,
837
 
838
        'captype' => 'write',
839
        'contextlevel' => CONTEXT_COURSE,
840
        'archetypes' => array(
841
            'manager' => CAP_ALLOW
842
        )
843
    ),
844
 
845
    'moodle/course:update' => array(
846
 
847
        'riskbitmask' => RISK_XSS,
848
 
849
        'captype' => 'write',
850
        'contextlevel' => CONTEXT_COURSE,
851
        'archetypes' => array(
852
            'editingteacher' => CAP_ALLOW,
853
            'manager' => CAP_ALLOW
854
        )
855
    ),
856
 
857
    'moodle/course:view' => array(
858
 
859
        'captype' => 'read',
860
        'contextlevel' => CONTEXT_COURSE,
861
        'archetypes' => array(
862
            'manager' => CAP_ALLOW,
863
        )
864
    ),
865
 
866
    /* review course enrolments - no group restrictions, it is really full access to all participants info*/
867
    'moodle/course:enrolreview' => array(
868
 
869
        'riskbitmask' => RISK_PERSONAL,
870
 
871
        'captype' => 'read',
872
        'contextlevel' => CONTEXT_COURSE,
873
        'archetypes' => array(
874
            'editingteacher' => CAP_ALLOW,
875
            'manager' => CAP_ALLOW,
876
        )
877
    ),
878
 
879
    /* add, remove, hide enrol instances in courses */
880
    'moodle/course:enrolconfig' => array(
881
 
882
        'riskbitmask' => RISK_PERSONAL,
883
 
884
        'captype' => 'write',
885
        'contextlevel' => CONTEXT_COURSE,
886
        'archetypes' => array(
887
            'editingteacher' => CAP_ALLOW,
888
            'manager' => CAP_ALLOW,
889
        )
890
    ),
891
 
892
    'moodle/course:reviewotherusers' => array(
893
 
894
        'captype' => 'read',
895
        'contextlevel' => CONTEXT_COURSE,
896
        'archetypes' => array(
897
            'editingteacher' => CAP_ALLOW,
898
            'manager' => CAP_ALLOW,
899
        ),
900
        'clonepermissionsfrom' => 'moodle/role:assign'
901
    ),
902
 
903
    'moodle/course:bulkmessaging' => array(
904
 
905
        'riskbitmask' => RISK_SPAM,
906
 
907
        'captype' => 'write',
908
        'contextlevel' => CONTEXT_COURSE,
909
        'archetypes' => array(
910
            'teacher' => CAP_ALLOW,
911
            'editingteacher' => CAP_ALLOW,
912
            'manager' => CAP_ALLOW
913
        )
914
    ),
915
 
916
    'moodle/course:viewhiddenuserfields' => array(
917
 
918
        'riskbitmask' => RISK_PERSONAL,
919
 
920
        'captype' => 'read',
921
        'contextlevel' => CONTEXT_COURSE,
922
        'archetypes' => array(
923
            'teacher' => CAP_ALLOW,
924
            'editingteacher' => CAP_ALLOW,
925
            'manager' => CAP_ALLOW
926
        )
927
    ),
928
 
929
    'moodle/course:viewhiddencourses' => array(
930
 
931
        'captype' => 'read',
932
        'contextlevel' => CONTEXT_COURSE,
933
        'archetypes' => array(
934
            'coursecreator' => CAP_ALLOW,
935
            'teacher' => CAP_ALLOW,
936
            'editingteacher' => CAP_ALLOW,
937
            'manager' => CAP_ALLOW
938
        )
939
    ),
940
 
941
    'moodle/course:visibility' => array(
942
 
943
        'captype' => 'write',
944
        'contextlevel' => CONTEXT_COURSE,
945
        'archetypes' => array(
946
            'editingteacher' => CAP_ALLOW,
947
            'manager' => CAP_ALLOW
948
        )
949
    ),
950
 
951
    'moodle/course:managefiles' => array(
952
 
953
        'riskbitmask' => RISK_XSS,
954
 
955
        'captype' => 'write',
956
        'contextlevel' => CONTEXT_COURSE,
957
        'archetypes' => array(
958
            'editingteacher' => CAP_ALLOW,
959
            'manager' => CAP_ALLOW
960
        )
961
    ),
962
 
963
    'moodle/course:ignoreavailabilityrestrictions' => array(
964
        'captype' => 'read',
965
        'contextlevel' => CONTEXT_MODULE,
966
        'archetypes' => array(
967
            'manager' => CAP_ALLOW,
968
            'coursecreator' => CAP_ALLOW,
969
            'editingteacher' => CAP_ALLOW,
970
            'teacher' => CAP_ALLOW,
971
        ),
972
        'clonepermissionsfrom' => 'moodle/course:viewhiddenactivities'
973
    ),
974
 
975
    'moodle/course:ignorefilesizelimits' => array(
976
 
977
        'captype' => 'write',
978
        'contextlevel' => CONTEXT_COURSE,
979
        'archetypes' => array(
980
        )
981
    ),
982
 
983
    'moodle/course:manageactivities' => array(
984
 
985
        'riskbitmask' => RISK_XSS,
986
 
987
        'captype' => 'write',
988
        'contextlevel' => CONTEXT_MODULE,
989
        'archetypes' => array(
990
            'editingteacher' => CAP_ALLOW,
991
            'manager' => CAP_ALLOW
992
        )
993
    ),
994
 
995
    'moodle/course:activityvisibility' => array(
996
 
997
        'captype' => 'write',
998
        'contextlevel' => CONTEXT_MODULE,
999
        'archetypes' => array(
1000
            'editingteacher' => CAP_ALLOW,
1001
            'manager' => CAP_ALLOW
1002
        )
1003
    ),
1004
 
1005
    'moodle/course:viewhiddenactivities' => array(
1006
 
1007
        'captype' => 'read',
1008
        'contextlevel' => CONTEXT_MODULE,
1009
        'archetypes' => array(
1010
            'teacher' => CAP_ALLOW,
1011
            'editingteacher' => CAP_ALLOW,
1012
            'manager' => CAP_ALLOW
1013
        )
1014
    ),
1015
 
1016
    'moodle/course:viewparticipants' => array(
1017
 
1018
        'captype' => 'read',
1019
        'contextlevel' => CONTEXT_COURSE,
1020
        'archetypes' => array(
1021
            'student' => CAP_ALLOW,
1022
            'teacher' => CAP_ALLOW,
1023
            'editingteacher' => CAP_ALLOW,
1024
            'manager' => CAP_ALLOW
1025
        )
1026
    ),
1027
 
1441 ariadna 1028
    'moodle/course:viewoverview' => [
1029
        'captype' => 'read',
1030
        'contextlevel' => CONTEXT_COURSE,
1031
        'archetypes' => [
1032
            'student' => CAP_ALLOW,
1033
            'teacher' => CAP_ALLOW,
1034
            'editingteacher' => CAP_ALLOW,
1035
            'manager' => CAP_ALLOW,
1036
        ],
1037
    ],
1038
 
1 efrain 1039
    'moodle/course:changefullname' => array(
1040
 
1041
        'riskbitmask' => RISK_XSS,
1042
 
1043
        'captype' => 'write',
1044
        'contextlevel' => CONTEXT_COURSE,
1045
        'archetypes' => array(
1046
            'editingteacher' => CAP_ALLOW,
1047
            'manager' => CAP_ALLOW
1048
        ),
1049
        'clonepermissionsfrom' => 'moodle/course:update'
1050
    ),
1051
 
1052
    'moodle/course:changeshortname' => array(
1053
 
1054
        'riskbitmask' => RISK_XSS,
1055
 
1056
        'captype' => 'write',
1057
        'contextlevel' => CONTEXT_COURSE,
1058
        'archetypes' => array(
1059
            'editingteacher' => CAP_ALLOW,
1060
            'manager' => CAP_ALLOW
1061
        ),
1062
        'clonepermissionsfrom' => 'moodle/course:update'
1063
    ),
1064
 
1065
    'moodle/course:changelockedcustomfields' => array(
1066
 
1067
        'riskbitmask' => RISK_SPAM,
1068
 
1069
        'captype' => 'write',
1070
        'contextlevel' => CONTEXT_COURSE,
1071
        'archetypes' => array(
1072
            'manager' => CAP_ALLOW
1073
        ),
1074
    ),
1075
 
1076
    'moodle/course:configurecustomfields' => array(
1077
 
1078
        'riskbitmask' => RISK_SPAM,
1079
 
1080
        'captype' => 'write',
1081
        'contextlevel' => CONTEXT_SYSTEM,
1082
        'clonepermissionsfrom' => 'moodle/site:config'
1083
    ),
1084
 
1085
    'moodle/course:renameroles' => array(
1086
        'captype' => 'write',
1087
        'contextlevel' => CONTEXT_COURSE,
1088
        'archetypes' => array(
1089
            'editingteacher' => CAP_ALLOW,
1090
            'manager' => CAP_ALLOW
1091
        ),
1092
        'clonepermissionsfrom' => 'moodle/course:update'
1093
    ),
1094
 
1095
    'moodle/course:changeidnumber' => array(
1096
 
1097
        'riskbitmask' => RISK_XSS,
1098
 
1099
        'captype' => 'write',
1100
        'contextlevel' => CONTEXT_COURSE,
1101
        'archetypes' => array(
1102
            'editingteacher' => CAP_ALLOW,
1103
            'manager' => CAP_ALLOW
1104
        ),
1105
        'clonepermissionsfrom' => 'moodle/course:update'
1106
    ),
1107
    'moodle/course:changecategory' => array(
1108
        'riskbitmask' => RISK_XSS,
1109
 
1110
        'captype' => 'write',
1111
        'contextlevel' => CONTEXT_COURSE,
1112
        'archetypes' => array(
1113
            'editingteacher' => CAP_ALLOW,
1114
            'manager' => CAP_ALLOW
1115
        ),
1116
        'clonepermissionsfrom' => 'moodle/course:update'
1117
    ),
1118
 
1119
    'moodle/course:changesummary' => array(
1120
        'riskbitmask' => RISK_XSS,
1121
 
1122
        'captype' => 'write',
1123
        'contextlevel' => CONTEXT_COURSE,
1124
        'archetypes' => array(
1125
            'editingteacher' => CAP_ALLOW,
1126
            'manager' => CAP_ALLOW
1127
        ),
1128
        'clonepermissionsfrom' => 'moodle/course:update'
1129
    ),
1130
 
1131
    // Ability to set a forced language for a course or activity.
1132
    'moodle/course:setforcedlanguage' => array(
1133
        'captype' => 'write',
1134
        'contextlevel' => CONTEXT_COURSE,
1135
        'archetypes' => array(
1136
            'editingteacher' => CAP_ALLOW,
1137
            'manager' => CAP_ALLOW
1138
        ),
1139
        'clonepermissionsfrom' => 'moodle/course:update'
1140
    ),
1141
 
1142
 
1143
    'moodle/site:viewparticipants' => array(
1144
 
1145
        'captype' => 'read',
1146
        'contextlevel' => CONTEXT_SYSTEM,
1147
        'archetypes' => array(
1148
            'manager' => CAP_ALLOW
1149
        )
1150
    ),
1151
 
1152
    'moodle/course:isincompletionreports' => array(
1153
        'captype' => 'read',
1154
        'contextlevel' => CONTEXT_COURSE,
1155
        'archetypes' => array(
1156
            'student' => CAP_ALLOW,
1157
        ),
1158
    ),
1159
 
1160
    'moodle/course:viewscales' => array(
1161
 
1162
        'captype' => 'read',
1163
        'contextlevel' => CONTEXT_COURSE,
1164
        'archetypes' => array(
1165
            'student' => CAP_ALLOW,
1166
            'teacher' => CAP_ALLOW,
1167
            'editingteacher' => CAP_ALLOW,
1168
            'manager' => CAP_ALLOW
1169
        )
1170
    ),
1171
 
1172
    'moodle/course:managescales' => array(
1173
 
1174
        'captype' => 'write',
1175
        'contextlevel' => CONTEXT_COURSE,
1176
        'archetypes' => array(
1177
            'editingteacher' => CAP_ALLOW,
1178
            'manager' => CAP_ALLOW
1179
        )
1180
    ),
1181
 
1182
    'moodle/course:managegroups' => array(
1183
        'riskbitmask' => RISK_XSS,
1184
 
1185
        'captype' => 'write',
1186
        'contextlevel' => CONTEXT_COURSE,
1187
        'archetypes' => array(
1188
            'editingteacher' => CAP_ALLOW,
1189
            'manager' => CAP_ALLOW
1190
        )
1191
    ),
1192
 
1193
    'moodle/course:viewhiddengroups' => array(
1194
        'riskbitmask' => RISK_PERSONAL,
1195
        'captype' => 'READ',
1196
        'contextlevel' => CONTEXT_COURSE,
1197
        'archetypes' => array(
1198
            'teacher' => CAP_ALLOW,
1199
            'editingteacher' => CAP_ALLOW,
1200
            'manager' => CAP_ALLOW
1201
        )
1202
    ),
1203
 
1204
    'moodle/course:reset' => array(
1205
 
1206
        'riskbitmask' => RISK_DATALOSS,
1207
 
1208
        'captype' => 'write',
1209
        'contextlevel' => CONTEXT_COURSE,
1210
        'archetypes' => array(
1211
            'editingteacher' => CAP_ALLOW,
1212
            'manager' => CAP_ALLOW
1213
        )
1214
    ),
1215
 
1216
    'moodle/course:viewsuspendedusers' => array(
1217
 
1218
        'captype' => 'read',
1219
        'contextlevel' => CONTEXT_COURSE,
1220
        'archetypes' => array(
1221
            'editingteacher' => CAP_ALLOW,
1222
            'manager' => CAP_ALLOW
1223
        )
1224
    ),
1225
 
1226
    'moodle/course:tag' => array(
1227
        'riskbitmask' => RISK_SPAM,
1228
        'captype' => 'write',
1229
        'contextlevel' => CONTEXT_COURSE,
1230
        'archetypes' => array(
1231
            'manager' => CAP_ALLOW,
1232
            'editingteacher' => CAP_ALLOW,
1233
        ),
1234
        'clonepermissionsfrom' => 'moodle/course:update'
1235
    ),
1236
 
1237
    'moodle/blog:view' => array(
1238
 
1239
        'captype' => 'read',
1240
        'contextlevel' => CONTEXT_SYSTEM,
1241
        'archetypes' => array(
1242
            'guest' => CAP_ALLOW,
1243
            'user' => CAP_ALLOW,
1244
            'student' => CAP_ALLOW,
1245
            'teacher' => CAP_ALLOW,
1246
            'editingteacher' => CAP_ALLOW,
1247
            'manager' => CAP_ALLOW
1248
        )
1249
    ),
1250
 
1251
    'moodle/blog:search' => array(
1252
        'captype' => 'read',
1253
        'contextlevel' => CONTEXT_SYSTEM,
1254
        'archetypes' => array(
1255
            'guest' => CAP_ALLOW,
1256
            'user' => CAP_ALLOW,
1257
            'student' => CAP_ALLOW,
1258
            'teacher' => CAP_ALLOW,
1259
            'editingteacher' => CAP_ALLOW,
1260
            'manager' => CAP_ALLOW
1261
        )
1262
    ),
1263
 
1264
    'moodle/blog:viewdrafts' => array(
1265
 
1266
        'riskbitmask' => RISK_PERSONAL,
1267
        'captype' => 'read',
1268
        'contextlevel' => CONTEXT_SYSTEM,
1269
        'archetypes' => array(
1270
            'manager' => CAP_ALLOW
1271
        )
1272
    ),
1273
 
1274
    'moodle/blog:create' => array( // works in CONTEXT_SYSTEM only
1275
 
1276
        'riskbitmask' => RISK_SPAM,
1277
 
1278
        'captype' => 'write',
1279
        'contextlevel' => CONTEXT_SYSTEM,
1280
        'archetypes' => array(
1281
            'user' => CAP_ALLOW,
1282
            'manager' => CAP_ALLOW
1283
        )
1284
    ),
1285
 
1286
    'moodle/blog:manageentries' => array(
1287
 
1288
        'riskbitmask' => RISK_SPAM,
1289
 
1290
        'captype' => 'write',
1291
        'contextlevel' => CONTEXT_SYSTEM,
1292
        'archetypes' => array(
1293
            'teacher' => CAP_ALLOW,
1294
            'editingteacher' => CAP_ALLOW,
1295
            'manager' => CAP_ALLOW
1296
        )
1297
    ),
1298
 
1299
    'moodle/blog:manageexternal' => array(
1300
 
1301
        'riskbitmask' => RISK_SPAM,
1302
 
1303
        'captype' => 'write',
1304
        'contextlevel' => CONTEXT_SYSTEM,
1305
        'archetypes' => array(
1306
            'student' => CAP_ALLOW,
1307
            'user' => CAP_ALLOW,
1308
            'teacher' => CAP_ALLOW,
1309
            'editingteacher' => CAP_ALLOW,
1310
            'manager' => CAP_ALLOW
1311
        )
1312
    ),
1313
 
1314
    'moodle/calendar:manageownentries' => array( // works in CONTEXT_SYSTEM only
1315
 
1316
        'riskbitmask' => RISK_SPAM,
1317
 
1318
        'captype' => 'write',
1319
        'contextlevel' => CONTEXT_COURSE,
1320
        'archetypes' => array(
1321
            'user' => CAP_ALLOW,
1322
            'manager' => CAP_ALLOW
1323
        )
1324
    ),
1325
 
1326
    'moodle/calendar:managegroupentries' => array(
1327
 
1328
        'riskbitmask' => RISK_SPAM,
1329
 
1330
        'captype' => 'write',
1331
        'contextlevel' => CONTEXT_COURSE,
1332
        'archetypes' => array(
1333
            'teacher' => CAP_ALLOW,
1334
            'editingteacher' => CAP_ALLOW,
1335
            'manager' => CAP_ALLOW
1336
        )
1337
    ),
1338
 
1339
    'moodle/calendar:manageentries' => array(
1340
 
1341
        'riskbitmask' => RISK_SPAM,
1342
 
1343
        'captype' => 'write',
1344
        'contextlevel' => CONTEXT_COURSE,
1345
        'archetypes' => array(
1346
            'teacher' => CAP_ALLOW,
1347
            'editingteacher' => CAP_ALLOW,
1348
            'manager' => CAP_ALLOW
1349
        )
1350
    ),
1351
 
1352
    'moodle/user:editprofile' => array(
1353
 
1354
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
1355
 
1356
        'captype' => 'write',
1357
        'contextlevel' => CONTEXT_USER,
1358
        'archetypes' => array(
1359
            'manager' => CAP_ALLOW
1360
        )
1361
    ),
1362
 
1363
    'moodle/user:editownprofile' => array(
1364
 
1365
        'riskbitmask' => RISK_SPAM,
1366
 
1367
        'captype' => 'write',
1368
        'contextlevel' => CONTEXT_SYSTEM,
1369
        'archetypes' => array(
1370
            'guest' => CAP_PROHIBIT,
1371
            'user' => CAP_ALLOW,
1372
            'manager' => CAP_ALLOW
1373
        )
1374
    ),
1375
 
1376
    'moodle/user:changeownpassword' => array(
1377
 
1378
        'captype' => 'write',
1379
        'contextlevel' => CONTEXT_SYSTEM,
1380
        'archetypes' => array(
1381
            'guest' => CAP_PROHIBIT,
1382
            'user' => CAP_ALLOW,
1383
            'manager' => CAP_ALLOW
1384
        )
1385
    ),
1386
 
1387
    // The next 3 might make no sense for some roles, e.g teacher, etc.
1388
    // since the next level up is site. These are more for the parent role
1389
    'moodle/user:readuserposts' => array(
1390
 
1391
        'captype' => 'read',
1392
        'contextlevel' => CONTEXT_USER,
1393
        'archetypes' => array(
1394
            'student' => CAP_ALLOW,
1395
            'teacher' => CAP_ALLOW,
1396
            'editingteacher' => CAP_ALLOW,
1397
            'manager' => CAP_ALLOW
1398
        )
1399
    ),
1400
 
1401
    'moodle/user:readuserblogs' => array(
1402
 
1403
        'captype' => 'read',
1404
        'contextlevel' => CONTEXT_USER,
1405
        'archetypes' => array(
1406
            'student' => CAP_ALLOW,
1407
            'teacher' => CAP_ALLOW,
1408
            'editingteacher' => CAP_ALLOW,
1409
            'manager' => CAP_ALLOW
1410
        )
1411
    ),
1412
 
1413
    // designed for parent role - not used in legacy roles
1414
    'moodle/user:viewuseractivitiesreport' => array(
1415
        'riskbitmask' => RISK_PERSONAL,
1416
 
1417
        'captype' => 'read',
1418
        'contextlevel' => CONTEXT_USER,
1419
        'archetypes' => array(
1420
        )
1421
    ),
1422
 
1423
    //capabilities designed for the new message system configuration
1424
    'moodle/user:editmessageprofile' => array(
1425
 
1426
         'riskbitmask' => RISK_SPAM,
1427
 
1428
         'captype' => 'write',
1429
         'contextlevel' => CONTEXT_USER,
1430
         'archetypes' => array(
1431
             'manager' => CAP_ALLOW
1432
         )
1433
     ),
1434
 
1435
     'moodle/user:editownmessageprofile' => array(
1436
 
1437
         'captype' => 'write',
1438
         'contextlevel' => CONTEXT_SYSTEM,
1439
         'archetypes' => array(
1440
             'guest' => CAP_PROHIBIT,
1441
             'user' => CAP_ALLOW,
1442
             'manager' => CAP_ALLOW
1443
         )
1444
     ),
1445
 
1446
    'moodle/question:managecategory' => array(
1447
        'riskbitmask' => RISK_SPAM | RISK_XSS,
1448
        'captype' => 'write',
1449
        'contextlevel' => CONTEXT_COURSE,
1450
        'archetypes' => array(
1451
            'editingteacher' => CAP_ALLOW,
1452
            'manager' => CAP_ALLOW
1453
        )
1454
    ),
1455
 
1456
    //new in moodle 1.9
1457
    'moodle/question:add' => array(
1458
        'riskbitmask' => RISK_SPAM | RISK_XSS,
1459
        'captype' => 'write',
1460
        'contextlevel' => CONTEXT_COURSE,
1461
        'archetypes' => array(
1462
            'editingteacher' => CAP_ALLOW,
1463
            'manager' => CAP_ALLOW
1464
        ),
1465
        'clonepermissionsfrom' =>  'moodle/question:manage'
1466
    ),
1467
    'moodle/question:editmine' => array(
1468
        'riskbitmask' => RISK_SPAM | RISK_XSS,
1469
        'captype' => 'write',
1470
        'contextlevel' => CONTEXT_COURSE,
1471
        'archetypes' => array(
1472
            'editingteacher' => CAP_ALLOW,
1473
            'manager' => CAP_ALLOW
1474
        ),
1475
        'clonepermissionsfrom' =>  'moodle/question:manage'
1476
    ),
1477
    'moodle/question:editall' => array(
1478
        'riskbitmask' => RISK_SPAM | RISK_XSS,
1479
        'captype' => 'write',
1480
        'contextlevel' => CONTEXT_COURSE,
1481
        'archetypes' => array(
1482
            'editingteacher' => CAP_ALLOW,
1483
            'manager' => CAP_ALLOW
1484
        ),
1485
        'clonepermissionsfrom' =>  'moodle/question:manage'
1486
    ),
1487
    'moodle/question:viewmine' => array(
1488
        'captype' => 'read',
1489
        'contextlevel' => CONTEXT_COURSE,
1490
        'archetypes' => array(
1491
            'editingteacher' => CAP_ALLOW,
1492
            'manager' => CAP_ALLOW
1493
        ),
1494
        'clonepermissionsfrom' =>  'moodle/question:manage'
1495
    ),
1496
    'moodle/question:viewall' => array(
1497
        'captype' => 'read',
1498
        'contextlevel' => CONTEXT_COURSE,
1499
        'archetypes' => array(
1500
            'editingteacher' => CAP_ALLOW,
1501
            'manager' => CAP_ALLOW
1502
        ),
1503
        'clonepermissionsfrom' =>  'moodle/question:manage'
1504
    ),
1505
    'moodle/question:usemine' => array(
1506
        'captype' => 'read',
1507
        'contextlevel' => CONTEXT_COURSE,
1508
        'archetypes' => array(
1441 ariadna 1509
            'teacher' => CAP_ALLOW,
1 efrain 1510
            'editingteacher' => CAP_ALLOW,
1511
            'manager' => CAP_ALLOW
1512
        ),
1513
        'clonepermissionsfrom' =>  'moodle/question:manage'
1514
    ),
1515
    'moodle/question:useall' => array(
1516
        'captype' => 'read',
1517
        'contextlevel' => CONTEXT_COURSE,
1518
        'archetypes' => array(
1441 ariadna 1519
            'teacher' => CAP_ALLOW,
1 efrain 1520
            'editingteacher' => CAP_ALLOW,
1521
            'manager' => CAP_ALLOW
1522
        ),
1523
        'clonepermissionsfrom' =>  'moodle/question:manage'
1524
    ),
1525
    'moodle/question:movemine' => array(
1526
        'captype' => 'write',
1527
        'contextlevel' => CONTEXT_COURSE,
1528
        'archetypes' => array(
1529
            'editingteacher' => CAP_ALLOW,
1530
            'manager' => CAP_ALLOW
1531
        ),
1532
        'clonepermissionsfrom' =>  'moodle/question:manage'
1533
    ),
1534
    'moodle/question:moveall' => array(
1535
        'captype' => 'write',
1536
        'contextlevel' => CONTEXT_COURSE,
1537
        'archetypes' => array(
1538
            'editingteacher' => CAP_ALLOW,
1539
            'manager' => CAP_ALLOW
1540
        ),
1541
        'clonepermissionsfrom' =>  'moodle/question:manage'
1542
    ),
1543
    //END new in moodle 1.9
1544
 
1545
    // Configure the installed question types.
1546
    'moodle/question:config' => array(
1547
        'riskbitmask' => RISK_CONFIG,
1548
        'captype' => 'write',
1549
        'contextlevel' => CONTEXT_SYSTEM,
1550
        'archetypes' => array(
1551
            'manager' => CAP_ALLOW
1552
        )
1553
    ),
1554
 
1555
    // While attempting questions, the ability to flag particular questions for later reference.
1556
    'moodle/question:flag' => array(
1557
        'captype' => 'write',
1558
        'contextlevel' => CONTEXT_COURSE,
1559
        'archetypes' => array(
1560
            'student' => CAP_ALLOW,
1561
            'teacher' => CAP_ALLOW,
1562
            'editingteacher' => CAP_ALLOW,
1563
            'manager' => CAP_ALLOW
1564
        )
1565
    ),
1566
 
1567
    // Controls whether the user can tag his own questions.
1568
    'moodle/question:tagmine' => array(
1569
        'captype' => 'write',
1570
        'contextlevel' => CONTEXT_COURSE,
1571
        'archetypes' => array(
1572
            'editingteacher' => CAP_ALLOW,
1573
            'manager' => CAP_ALLOW
1574
        ),
1575
        'clonepermissionsfrom' => 'moodle/question:editmine'
1576
    ),
1577
 
1578
    // Controls whether the user can tag all questions.
1579
    'moodle/question:tagall' => array(
1580
        'captype' => 'write',
1581
        'contextlevel' => CONTEXT_COURSE,
1582
        'archetypes' => array(
1583
            'editingteacher' => CAP_ALLOW,
1584
            'manager' => CAP_ALLOW
1585
        ),
1586
        'clonepermissionsfrom' => 'moodle/question:editall'
1587
    ),
1588
 
1589
    'moodle/site:doclinks' => array(
1590
        'captype' => 'read',
1591
        'contextlevel' => CONTEXT_SYSTEM,
1592
        'archetypes' => array(
1593
            'teacher' => CAP_ALLOW,
1594
            'editingteacher' => CAP_ALLOW,
1595
            'manager' => CAP_ALLOW
1596
        )
1597
    ),
1598
 
1599
    'moodle/course:sectionvisibility' => array(
1600
 
1601
        'captype' => 'write',
1602
        'contextlevel' => CONTEXT_COURSE,
1603
        'archetypes' => array(
1604
            'editingteacher' => CAP_ALLOW,
1605
            'manager' => CAP_ALLOW
1606
        )
1607
    ),
1608
 
1609
    'moodle/course:useremail' => array(
1610
 
1611
        'captype' => 'write',
1612
        'contextlevel' => CONTEXT_COURSE,
1613
        'archetypes' => array(
1614
            'editingteacher' => CAP_ALLOW,
1615
            'manager' => CAP_ALLOW
1616
        )
1617
    ),
1618
 
1619
    'moodle/course:viewhiddensections' => array(
1620
 
1621
        'captype' => 'read',
1622
        'contextlevel' => CONTEXT_COURSE,
1623
        'archetypes' => array(
1624
            'editingteacher' => CAP_ALLOW,
1625
            'manager' => CAP_ALLOW
1626
        )
1627
    ),
1628
 
1629
    'moodle/course:setcurrentsection' => array(
1630
 
1631
        'captype' => 'write',
1632
        'contextlevel' => CONTEXT_COURSE,
1633
        'archetypes' => array(
1634
            'editingteacher' => CAP_ALLOW,
1635
            'manager' => CAP_ALLOW
1636
        )
1637
    ),
1638
 
1639
    'moodle/course:movesections' => array(
1640
 
1641
        'captype' => 'write',
1642
        'contextlevel' => CONTEXT_COURSE,
1643
        'archetypes' => array(
1644
            'editingteacher' => CAP_ALLOW,
1645
            'manager' => CAP_ALLOW
1646
        ),
1647
        'clonepermissionsfrom' => 'moodle/course:update'
1648
    ),
1649
 
1650
    'moodle/site:mnetlogintoremote' => array(
1651
 
1652
        'captype' => 'read',
1653
        'contextlevel' => CONTEXT_SYSTEM,
1654
        'archetypes' => array(
1655
        )
1656
    ),
1657
 
1658
    'moodle/grade:viewall' => array(
1659
        'riskbitmask' => RISK_PERSONAL,
1660
        'captype' => 'read',
1661
        'contextlevel' => CONTEXT_COURSE, // and CONTEXT_USER
1662
        'archetypes' => array(
1663
            'teacher' => CAP_ALLOW,
1664
            'editingteacher' => CAP_ALLOW,
1665
            'manager' => CAP_ALLOW
1666
        ),
1667
        'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
1668
    ),
1669
 
1670
    'moodle/grade:view' => array(
1671
        'captype' => 'read',
1672
        'contextlevel' => CONTEXT_COURSE,
1673
        'archetypes' => array(
1674
            'student' => CAP_ALLOW
1675
        )
1676
    ),
1677
 
1678
    'moodle/grade:viewhidden' => array(
1679
        'riskbitmask' => RISK_PERSONAL,
1680
        'captype' => 'read',
1681
        'contextlevel' => CONTEXT_COURSE,
1682
        'archetypes' => array(
1683
            'teacher' => CAP_ALLOW,
1684
            'editingteacher' => CAP_ALLOW,
1685
            'manager' => CAP_ALLOW
1686
        ),
1687
        'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
1688
    ),
1689
 
1690
    'moodle/grade:import' => array(
1691
        'riskbitmask' => RISK_PERSONAL | RISK_XSS,
1692
        'captype' => 'write',
1693
        'contextlevel' => CONTEXT_COURSE,
1694
        'archetypes' => array(
1695
            'editingteacher' => CAP_ALLOW,
1696
            'manager' => CAP_ALLOW
1697
        ),
1698
        'clonepermissionsfrom' => 'moodle/course:managegrades'
1699
    ),
1700
 
1701
    'moodle/grade:export' => array(
1702
        'riskbitmask' => RISK_PERSONAL,
1703
        'captype' => 'read',
1704
        'contextlevel' => CONTEXT_COURSE,
1705
        'archetypes' => array(
1706
            'teacher' => CAP_ALLOW,
1707
            'editingteacher' => CAP_ALLOW,
1708
            'manager' => CAP_ALLOW
1709
        ),
1710
        'clonepermissionsfrom' => 'moodle/course:managegrades'
1711
    ),
1712
 
1713
    'moodle/grade:manage' => array(
1714
        'riskbitmask' => RISK_PERSONAL | RISK_XSS,
1715
        'captype' => 'write',
1716
        'contextlevel' => CONTEXT_COURSE,
1717
        'archetypes' => array(
1718
            'editingteacher' => CAP_ALLOW,
1719
            'manager' => CAP_ALLOW
1720
        ),
1721
        'clonepermissionsfrom' => 'moodle/course:managegrades'
1722
    ),
1723
 
1724
    'moodle/grade:edit' => array(
1725
        'riskbitmask' => RISK_PERSONAL | RISK_XSS,
1726
        'captype' => 'write',
1727
        'contextlevel' => CONTEXT_COURSE,
1728
        'archetypes' => array(
1729
            'editingteacher' => CAP_ALLOW,
1730
            'manager' => CAP_ALLOW
1731
        ),
1732
        'clonepermissionsfrom' => 'moodle/course:managegrades'
1733
    ),
1734
 
1735
    // ability to define advanced grading forms in activities either from scratch
1736
    // or from a shared template
1737
    'moodle/grade:managegradingforms' => array(
1738
        'riskbitmask' => RISK_PERSONAL | RISK_XSS,
1739
        'captype' => 'write',
1740
        'contextlevel' => CONTEXT_COURSE,
1741
        'archetypes' => array(
1742
            'editingteacher' => CAP_ALLOW,
1743
            'manager' => CAP_ALLOW
1744
        ),
1745
        'clonepermissionsfrom' => 'moodle/course:managegrades'
1746
    ),
1747
 
1748
    // ability to save a grading form as a new shared template and eventually edit
1749
    // and remove own templates (templates originally shared by that user)
1750
    'moodle/grade:sharegradingforms' => array(
1751
        'riskbitmask' => RISK_XSS,
1752
        'captype' => 'write',
1753
        'contextlevel' => CONTEXT_SYSTEM,
1754
        'archetypes' => array(
1755
            'manager' => CAP_ALLOW
1756
        ),
1757
    ),
1758
 
1759
    // ability to edit and remove any shared template, even those originally shared
1760
    // by other users
1761
    'moodle/grade:managesharedforms' => array(
1762
        'riskbitmask' => RISK_XSS,
1763
        'captype' => 'write',
1764
        'contextlevel' => CONTEXT_SYSTEM,
1765
        'archetypes' => array(
1766
            'manager' => CAP_ALLOW
1767
        ),
1768
    ),
1769
 
1770
    'moodle/grade:manageoutcomes' => array(
1771
        'captype' => 'write',
1772
        'contextlevel' => CONTEXT_COURSE,
1773
        'archetypes' => array(
1774
            'editingteacher' => CAP_ALLOW,
1775
            'manager' => CAP_ALLOW
1776
        ),
1777
        'clonepermissionsfrom' => 'moodle/course:managegrades'
1778
    ),
1779
 
1780
    'moodle/grade:manageletters' => array(
1781
        'captype' => 'write',
1782
        'contextlevel' => CONTEXT_COURSE,
1783
        'archetypes' => array(
1784
            'editingteacher' => CAP_ALLOW,
1785
            'manager' => CAP_ALLOW
1786
        ),
1787
        'clonepermissionsfrom' => 'moodle/course:managegrades'
1788
    ),
1789
 
1790
    'moodle/grade:hide' => array(
1791
        'captype' => 'write',
1792
        'contextlevel' => CONTEXT_COURSE,
1793
        'archetypes' => array(
1794
            'editingteacher' => CAP_ALLOW,
1795
            'manager' => CAP_ALLOW
1796
        )
1797
    ),
1798
 
1799
    'moodle/grade:lock' => array(
1800
        'captype' => 'write',
1801
        'contextlevel' => CONTEXT_COURSE,
1802
        'archetypes' => array(
1803
            'editingteacher' => CAP_ALLOW,
1804
            'manager' => CAP_ALLOW
1805
        )
1806
    ),
1807
 
1808
    'moodle/grade:unlock' => array(
1809
        'captype' => 'write',
1810
        'contextlevel' => CONTEXT_COURSE,
1811
        'archetypes' => array(
1812
            'editingteacher' => CAP_ALLOW,
1813
            'manager' => CAP_ALLOW
1814
        )
1815
    ),
1816
 
1817
    'moodle/my:manageblocks' => array(
1818
        'captype' => 'write',
1819
        'contextlevel' => CONTEXT_SYSTEM,
1820
        'archetypes' => array(
1821
            'user' => CAP_ALLOW
1822
        )
1823
    ),
1824
 
1825
    'moodle/notes:view' => array(
1826
        'captype' => 'read',
1827
        'contextlevel' => CONTEXT_COURSE,
1828
        'archetypes' => array(
1829
            'teacher' => CAP_ALLOW,
1830
            'editingteacher' => CAP_ALLOW,
1831
            'manager' => CAP_ALLOW
1832
        )
1833
    ),
1834
 
1835
    'moodle/notes:manage' => array(
1836
        'riskbitmask' => RISK_SPAM,
1837
 
1838
        'captype' => 'write',
1839
        'contextlevel' => CONTEXT_COURSE,
1840
        'archetypes' => array(
1841
            'teacher' => CAP_ALLOW,
1842
            'editingteacher' => CAP_ALLOW,
1843
            'manager' => CAP_ALLOW
1844
        )
1845
    ),
1846
 
1847
    'moodle/tag:manage' => array(
1848
        'riskbitmask' => RISK_SPAM,
1849
 
1850
        'captype' => 'write',
1851
        'contextlevel' => CONTEXT_SYSTEM,
1852
        'archetypes' => array(
1853
            'manager' => CAP_ALLOW
1854
        )
1855
    ),
1856
 
1857
    'moodle/tag:edit' => array(
1858
        'riskbitmask' => RISK_SPAM,
1859
 
1860
        'captype' => 'write',
1861
        'contextlevel' => CONTEXT_SYSTEM,
1862
        'archetypes' => array(
1863
            'manager' => CAP_ALLOW
1864
        )
1865
    ),
1866
 
1867
    'moodle/tag:flag' => array(
1868
        'riskbitmask' => RISK_SPAM,
1869
 
1870
        'captype' => 'write',
1871
        'contextlevel' => CONTEXT_SYSTEM,
1872
        'archetypes' => array(
1873
            'user' => CAP_ALLOW
1874
        )
1875
    ),
1876
 
1877
    'moodle/tag:editblocks' => array(
1878
        'captype' => 'write',
1879
        'contextlevel' => CONTEXT_SYSTEM,
1880
        'archetypes' => array(
1881
            'teacher' => CAP_ALLOW,
1882
            'editingteacher' => CAP_ALLOW,
1883
            'manager' => CAP_ALLOW
1884
        )
1885
    ),
1886
 
1887
    'moodle/block:view' => array(
1888
        'captype' => 'read',
1889
        'contextlevel' => CONTEXT_BLOCK,
1890
        'archetypes' => array(
1891
            'guest' => CAP_ALLOW,
1892
            'user' => CAP_ALLOW,
1893
            'student' => CAP_ALLOW,
1894
            'teacher' => CAP_ALLOW,
1895
            'editingteacher' => CAP_ALLOW,
1896
        )
1897
    ),
1898
 
1899
    'moodle/block:edit' => array(
1900
        'riskbitmask' => RISK_SPAM | RISK_XSS,
1901
 
1902
        'captype' => 'write',
1903
        'contextlevel' => CONTEXT_BLOCK,
1904
        'archetypes' => array(
1905
            'editingteacher' => CAP_ALLOW,
1906
            'manager' => CAP_ALLOW
1907
        )
1908
    ),
1909
 
1910
    'moodle/portfolio:export' => array(
1911
        'captype' => 'read',
1912
        'contextlevel' => CONTEXT_SYSTEM,
1913
        'archetypes' => array(
1914
            'user' => CAP_ALLOW,
1915
            'student' => CAP_ALLOW,
1916
            'teacher' => CAP_ALLOW,
1917
            'editingteacher' => CAP_ALLOW,
1918
        )
1919
    ),
1920
    'moodle/comment:view' => array(
1921
        'captype' => 'read',
1922
        'contextlevel' => CONTEXT_COURSE,
1923
        'archetypes' => array(
1924
            'frontpage' => CAP_ALLOW,
1925
            'guest' => CAP_ALLOW,
1926
            'user' => CAP_ALLOW,
1927
            'student' => CAP_ALLOW,
1928
            'teacher' => CAP_ALLOW,
1929
            'editingteacher' => CAP_ALLOW,
1930
            'manager' => CAP_ALLOW
1931
        )
1932
    ),
1933
    'moodle/comment:post' => array(
1934
 
1935
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
1936
        'captype' => 'write',
1937
        'contextlevel' => CONTEXT_COURSE,
1938
        'archetypes' => array(
1939
            'user' => CAP_ALLOW,
1940
            'student' => CAP_ALLOW,
1941
            'teacher' => CAP_ALLOW,
1942
            'editingteacher' => CAP_ALLOW,
1943
            'manager' => CAP_ALLOW
1944
        )
1945
    ),
1946
    'moodle/comment:delete' => array(
1947
 
1948
        'riskbitmask' => RISK_DATALOSS,
1949
        'captype' => 'write',
1950
        'contextlevel' => CONTEXT_COURSE,
1951
        'archetypes' => array(
1952
            'editingteacher' => CAP_ALLOW,
1953
            'manager' => CAP_ALLOW
1954
        )
1955
    ),
1956
    'moodle/webservice:createtoken' => array(
1957
 
1958
        'riskbitmask' => RISK_CONFIG | RISK_DATALOSS | RISK_SPAM | RISK_PERSONAL | RISK_XSS,
1959
        'captype' => 'write',
1960
        'contextlevel' => CONTEXT_SYSTEM,
1961
        'archetypes' => array(
1962
            'manager' => CAP_ALLOW
1963
        )
1964
    ),
1965
    'moodle/webservice:managealltokens' => array(
1966
 
1967
        'riskbitmask' => RISK_CONFIG | RISK_DATALOSS | RISK_PERSONAL,
1968
        'captype' => 'write',
1969
        'contextlevel' => CONTEXT_SYSTEM,
1970
        'archetypes' => array()
1971
    ),
1972
    'moodle/webservice:createmobiletoken' => array(
1973
 
1974
        'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
1975
        'captype' => 'write',
1976
        'contextlevel' => CONTEXT_SYSTEM,
1977
        'archetypes' => array(
1978
            'user' => CAP_ALLOW
1979
        )
1980
    ),
1981
    'moodle/rating:view' => array(
1982
 
1983
        'captype' => 'read',
1984
        'contextlevel' => CONTEXT_COURSE,
1985
        'archetypes' => array(
1986
            'user' => CAP_ALLOW,
1987
            'student' => CAP_ALLOW,
1988
            'teacher' => CAP_ALLOW,
1989
            'editingteacher' => CAP_ALLOW,
1990
            'manager' => CAP_ALLOW
1991
        )
1992
    ),
1993
    'moodle/rating:viewany' => array(
1994
 
1995
        'riskbitmask' => RISK_PERSONAL,
1996
        'captype' => 'read',
1997
        'contextlevel' => CONTEXT_COURSE,
1998
        'archetypes' => array(
1999
            'user' => CAP_ALLOW,
2000
            'student' => CAP_ALLOW,
2001
            'teacher' => CAP_ALLOW,
2002
            'editingteacher' => CAP_ALLOW,
2003
            'manager' => CAP_ALLOW
2004
        )
2005
    ),
2006
    'moodle/rating:viewall' => array(
2007
 
2008
        'riskbitmask' => RISK_PERSONAL,
2009
        'captype' => 'read',
2010
        'contextlevel' => CONTEXT_COURSE,
2011
        'archetypes' => array(
2012
            'user' => CAP_ALLOW,
2013
            'student' => CAP_ALLOW,
2014
            'teacher' => CAP_ALLOW,
2015
            'editingteacher' => CAP_ALLOW,
2016
            'manager' => CAP_ALLOW
2017
        )
2018
    ),
2019
    'moodle/rating:rate' => array(
2020
 
2021
        'captype' => 'write',
2022
        'contextlevel' => CONTEXT_COURSE,
2023
        'archetypes' => array(
2024
            'user' => CAP_ALLOW,
2025
            'student' => CAP_ALLOW,
2026
            'teacher' => CAP_ALLOW,
2027
            'editingteacher' => CAP_ALLOW,
2028
            'manager' => CAP_ALLOW
2029
        )
2030
    ),
2031
    'moodle/course:markcomplete' => array(
2032
        'captype' => 'write',
2033
        'contextlevel' => CONTEXT_COURSE,
2034
        'archetypes' => array(
2035
            'teacher' => CAP_ALLOW,
2036
            'editingteacher' => CAP_ALLOW,
2037
            'manager' => CAP_ALLOW
2038
        )
2039
    ),
2040
    'moodle/course:overridecompletion' => array(
2041
        'captype' => 'write',
2042
        'contextlevel' => CONTEXT_COURSE,
2043
        'archetypes' => array(
2044
            'teacher' => CAP_ALLOW,
2045
            'editingteacher' => CAP_ALLOW,
2046
            'manager' => CAP_ALLOW
2047
        )
2048
    ),
2049
 
2050
    // Badges.
2051
    'moodle/badges:manageglobalsettings' => array(
2052
        'riskbitmask'  => RISK_DATALOSS | RISK_CONFIG,
2053
        'captype'      => 'write',
2054
        'contextlevel' => CONTEXT_SYSTEM,
2055
        'archetypes'   => array(
2056
            'manager'       => CAP_ALLOW,
2057
        )
2058
    ),
2059
 
2060
    // View available badges without earning them.
2061
    'moodle/badges:viewbadges' => array(
2062
        'captype'       => 'read',
2063
        'contextlevel'  => CONTEXT_COURSE,
2064
        'archetypes'    => array(
2065
            'user'          => CAP_ALLOW,
2066
        )
2067
    ),
2068
 
2069
    // Manage badges on own private badges page.
2070
    'moodle/badges:manageownbadges' => array(
2071
        'riskbitmap'    => RISK_SPAM,
2072
        'captype'       => 'write',
2073
        'contextlevel'  => CONTEXT_USER,
2074
        'archetypes'    => array(
2075
            'user'    => CAP_ALLOW
2076
        )
2077
    ),
2078
 
2079
    // View public badges in other users' profiles.
2080
    'moodle/badges:viewotherbadges' => array(
2081
        'riskbitmap'    => RISK_PERSONAL,
2082
        'captype'       => 'read',
2083
        'contextlevel'  => CONTEXT_USER,
2084
        'archetypes'    => array(
2085
            'user'    => CAP_ALLOW
2086
        )
2087
    ),
2088
 
2089
    // Earn badge.
2090
    'moodle/badges:earnbadge' => array(
2091
        'captype'       => 'write',
2092
        'contextlevel'  => CONTEXT_COURSE,
2093
        'archetypes'    => array(
2094
            'user'           => CAP_ALLOW,
2095
        )
2096
    ),
2097
 
2098
    // Create/duplicate badges.
2099
    'moodle/badges:createbadge' => array(
2100
        'riskbitmask'  => RISK_SPAM,
2101
        'captype'      => 'write',
2102
        'contextlevel' => CONTEXT_COURSE,
2103
        'archetypes'   => array(
2104
            'manager'        => CAP_ALLOW,
2105
            'editingteacher' => CAP_ALLOW,
2106
        )
2107
    ),
2108
 
2109
    // Delete badges.
2110
    'moodle/badges:deletebadge' => array(
2111
        'riskbitmask'  => RISK_DATALOSS,
2112
        'captype'      => 'write',
2113
        'contextlevel' => CONTEXT_COURSE,
2114
        'archetypes'   => array(
2115
            'manager'        => CAP_ALLOW,
2116
            'editingteacher' => CAP_ALLOW,
2117
        )
2118
    ),
2119
 
2120
    // Set up/edit badge details.
2121
    'moodle/badges:configuredetails' => array(
2122
        'riskbitmask'  => RISK_SPAM,
2123
        'captype'      => 'write',
2124
        'contextlevel' => CONTEXT_COURSE,
2125
        'archetypes'   => array(
2126
            'manager'        => CAP_ALLOW,
2127
            'editingteacher' => CAP_ALLOW,
2128
        )
2129
    ),
2130
 
2131
    // Set up/edit criteria of earning a badge.
2132
    'moodle/badges:configurecriteria' => array(
2133
        'riskbitmask'  => RISK_XSS,
2134
        'captype'      => 'write',
2135
        'contextlevel' => CONTEXT_COURSE,
2136
        'archetypes'   => array(
2137
            'manager'        => CAP_ALLOW,
2138
            'editingteacher' => CAP_ALLOW,
2139
        )
2140
    ),
2141
 
2142
    // Configure badge messages.
2143
    'moodle/badges:configuremessages' => array(
2144
        'riskbitmask'  => RISK_SPAM,
2145
        'captype'      => 'write',
2146
        'contextlevel' => CONTEXT_COURSE,
2147
        'archetypes'   => array(
2148
            'manager'        => CAP_ALLOW,
2149
            'editingteacher' => CAP_ALLOW,
2150
        )
2151
    ),
2152
 
2153
    // Award badge to a user.
2154
    'moodle/badges:awardbadge' => array(
2155
        'riskbitmask'  => RISK_SPAM,
2156
        'captype'      => 'write',
2157
        'contextlevel' => CONTEXT_COURSE,
2158
        'archetypes'   => array(
2159
            'manager'        => CAP_ALLOW,
2160
            'teacher'        => CAP_ALLOW,
2161
            'editingteacher' => CAP_ALLOW,
2162
        )
2163
    ),
2164
 
2165
    // Revoke badge from a user.
2166
    'moodle/badges:revokebadge' => array(
2167
        'riskbitmask'  => RISK_SPAM,
2168
        'captype'      => 'write',
2169
        'contextlevel' => CONTEXT_COURSE,
2170
        'archetypes'   => array(
2171
            'manager'        => CAP_ALLOW,
2172
            'teacher'        => CAP_ALLOW,
2173
            'editingteacher' => CAP_ALLOW,
2174
        )
2175
    ),
2176
 
2177
    // View users who earned a specific badge without being able to award a badge.
2178
    'moodle/badges:viewawarded' => array(
2179
        'riskbitmask'  => RISK_PERSONAL,
2180
        'captype'      => 'read',
2181
        'contextlevel' => CONTEXT_COURSE,
2182
        'archetypes'   => array(
2183
                'manager'        => CAP_ALLOW,
2184
                'teacher'        => CAP_ALLOW,
2185
                'editingteacher' => CAP_ALLOW,
2186
        )
2187
    ),
2188
 
2189
    'moodle/site:forcelanguage' => array(
2190
        'captype' => 'read',
2191
        'contextlevel' => CONTEXT_SYSTEM,
2192
        'archetypes' => array(
2193
        )
2194
    ),
2195
 
2196
    // Perform site-wide search queries through the search API.
2197
    'moodle/search:query' => array(
2198
        'captype' => 'read',
2199
        'contextlevel' => CONTEXT_SYSTEM,
2200
        'archetypes' => array(
2201
            'guest' => CAP_ALLOW,
2202
            'user' => CAP_ALLOW,
2203
            'student' => CAP_ALLOW,
2204
            'teacher' => CAP_ALLOW,
2205
            'editingteacher' => CAP_ALLOW,
2206
            'manager' => CAP_ALLOW
2207
        )
2208
    ),
2209
 
2210
    // Competencies.
2211
    'moodle/competency:competencymanage' => array(
2212
        'captype' => 'write',
2213
        'contextlevel' => CONTEXT_COURSECAT,
2214
        'archetypes' => array(
2215
            'manager' => CAP_ALLOW
2216
        )
2217
    ),
2218
    'moodle/competency:competencyview' => array(
2219
        'captype' => 'read',
2220
        'contextlevel' => CONTEXT_COURSECAT,
2221
        'archetypes' => array(
2222
            'user' => CAP_ALLOW
2223
        ),
2224
    ),
2225
    'moodle/competency:competencygrade' => array(
2226
        'captype' => 'write',
2227
        'contextlevel' => CONTEXT_COURSE, // And CONTEXT_USER.
2228
        'archetypes' => array(
2229
            'editingteacher' => CAP_ALLOW,
2230
            'teacher' => CAP_ALLOW,
2231
            'manager' => CAP_ALLOW
2232
        ),
2233
    ),
2234
    // Course competencies.
2235
    'moodle/competency:coursecompetencymanage' => array(
2236
        'captype' => 'write',
2237
        'contextlevel' => CONTEXT_COURSE,
2238
        'archetypes' => array(
2239
            'editingteacher' => CAP_ALLOW,
2240
            'manager' => CAP_ALLOW
2241
        ),
2242
    ),
2243
    'moodle/competency:coursecompetencyconfigure' => array(
2244
        'captype' => 'write',
2245
        'contextlevel' => CONTEXT_MODULE,
2246
        'archetypes' => array(
2247
            'manager' => CAP_ALLOW
2248
        ),
2249
    ),
2250
    'moodle/competency:coursecompetencygradable' => array(
2251
        'captype' => 'read',
2252
        'contextlevel' => CONTEXT_COURSE,
2253
        'archetypes' => array(
2254
            'student' => CAP_ALLOW
2255
        ),
2256
        'clonepermissionsfrom' => 'moodle/course:isincompletionreports'
2257
    ),
2258
    'moodle/competency:coursecompetencyview' => array(
2259
        'captype' => 'read',
2260
        'contextlevel' => CONTEXT_COURSE,
2261
        'archetypes' => array(
2262
            'user' => CAP_ALLOW
2263
        ),
2264
    ),
2265
    // Evidence.
2266
    'moodle/competency:evidencedelete' => array(
2267
        'captype' => 'write',
2268
        'contextlevel' => CONTEXT_USER,
2269
        'archetypes' => array(
2270
        ),
2271
        'clonepermissionsfrom' => 'moodle/site:config'
2272
    ),
2273
    // User plans.
2274
    'moodle/competency:planmanage' => array(
2275
        'captype' => 'write',
2276
        'contextlevel' => CONTEXT_USER,
2277
        'archetypes' => array(
2278
            'manager' => CAP_ALLOW
2279
        ),
2280
    ),
2281
    'moodle/competency:planmanagedraft' => array(
2282
        'captype' => 'write',
2283
        'contextlevel' => CONTEXT_USER,
2284
        'archetypes' => array(
2285
            'manager' => CAP_ALLOW
2286
        ),
2287
    ),
2288
    'moodle/competency:planmanageown' => array(
2289
        'captype' => 'write',
2290
        'contextlevel' => CONTEXT_USER,
2291
        'archetypes' => array(
2292
        ),
2293
    ),
2294
    'moodle/competency:planmanageowndraft' => array(
2295
        'captype' => 'write',
2296
        'contextlevel' => CONTEXT_USER,
2297
        'archetypes' => array(
2298
        ),
2299
    ),
2300
    'moodle/competency:planview' => array(
2301
        'captype' => 'read',
2302
        'contextlevel' => CONTEXT_USER,
2303
        'archetypes' => array(
2304
            'manager' => CAP_ALLOW
2305
        ),
2306
    ),
2307
    'moodle/competency:planviewdraft' => array(
2308
        'captype' => 'read',
2309
        'contextlevel' => CONTEXT_USER,
2310
        'archetypes' => array(
2311
            'manager' => CAP_ALLOW
2312
        ),
2313
    ),
2314
    'moodle/competency:planviewown' => array(
2315
        'captype' => 'read',
2316
        'contextlevel' => CONTEXT_USER,
2317
        'archetypes' => array(
2318
            'user' => CAP_ALLOW
2319
        ),
2320
    ),
2321
    'moodle/competency:planviewowndraft' => array(
2322
        'captype' => 'read',
2323
        'contextlevel' => CONTEXT_USER,
2324
        'archetypes' => array(
2325
        ),
2326
    ),
2327
    'moodle/competency:planrequestreview' => array(
2328
        'captype' => 'write',
2329
        'contextlevel' => CONTEXT_USER,
2330
        'archetypes' => array(
2331
            'manager' => CAP_ALLOW
2332
        )
2333
    ),
2334
    'moodle/competency:planrequestreviewown' => array(
2335
        'captype' => 'write',
2336
        'contextlevel' => CONTEXT_USER,
2337
        'archetypes' => array(
2338
            'user' => CAP_ALLOW
2339
        )
2340
    ),
2341
    'moodle/competency:planreview' => array(
2342
        'captype' => 'write',
2343
        'contextlevel' => CONTEXT_USER,
2344
        'archetypes' => array(
2345
            'manager' => CAP_ALLOW
2346
        ),
2347
    ),
2348
    'moodle/competency:plancomment' => array(
2349
        'captype' => 'write',
2350
        'contextlevel' => CONTEXT_USER,
2351
        'archetypes' => array(
2352
            'manager' => CAP_ALLOW
2353
        ),
2354
    ),
2355
    'moodle/competency:plancommentown' => array(
2356
        'captype' => 'write',
2357
        'contextlevel' => CONTEXT_USER,
2358
        'archetypes' => array(
2359
            'user' => CAP_ALLOW
2360
        ),
2361
    ),
2362
    // User competencies.
2363
    'moodle/competency:usercompetencyview' => array(
2364
        'captype' => 'read',
2365
        'contextlevel' => CONTEXT_USER,     // And CONTEXT_COURSE.
2366
        'archetypes' => array(
2367
            'manager' => CAP_ALLOW,
2368
            'editingteacher' => CAP_ALLOW,
2369
            'teacher' => CAP_ALLOW
2370
        )
2371
    ),
2372
    'moodle/competency:usercompetencyrequestreview' => array(
2373
        'captype' => 'write',
2374
        'contextlevel' => CONTEXT_USER,
2375
        'archetypes' => array(
2376
            'manager' => CAP_ALLOW
2377
        )
2378
    ),
2379
    'moodle/competency:usercompetencyrequestreviewown' => array(
2380
        'captype' => 'write',
2381
        'contextlevel' => CONTEXT_USER,
2382
        'archetypes' => array(
2383
            'user' => CAP_ALLOW
2384
        )
2385
    ),
2386
    'moodle/competency:usercompetencyreview' => array(
2387
        'captype' => 'write',
2388
        'contextlevel' => CONTEXT_USER,
2389
        'archetypes' => array(
2390
            'manager' => CAP_ALLOW
2391
        ),
2392
    ),
2393
    'moodle/competency:usercompetencycomment' => array(
2394
        'captype' => 'write',
2395
        'contextlevel' => CONTEXT_USER,
2396
        'archetypes' => array(
2397
            'manager' => CAP_ALLOW
2398
        ),
2399
    ),
2400
    'moodle/competency:usercompetencycommentown' => array(
2401
        'captype' => 'write',
2402
        'contextlevel' => CONTEXT_USER,
2403
        'archetypes' => array(
2404
            'user' => CAP_ALLOW
2405
        ),
2406
    ),
2407
    // Template.
2408
    'moodle/competency:templatemanage' => array(
2409
        'captype' => 'write',
2410
        'contextlevel' => CONTEXT_COURSECAT,
2411
        'archetypes' => array(
2412
            'manager' => CAP_ALLOW
2413
        ),
2414
    ),
2415
    'moodle/analytics:listinsights' => array(
2416
        'riskbitmask' => RISK_PERSONAL,
2417
        'captype' => 'read',
2418
        'contextlevel' => CONTEXT_COURSE,
2419
        'archetypes' => array(
2420
            'teacher' => CAP_ALLOW,
2421
            'editingteacher' => CAP_ALLOW,
2422
            'manager' => CAP_ALLOW
2423
        )
2424
    ),
2425
    'moodle/analytics:managemodels' => array(
2426
        'riskbitmask' => RISK_CONFIG,
2427
        'captype' => 'write',
2428
        'contextlevel' => CONTEXT_SYSTEM,
2429
        'archetypes' => array(
2430
            'manager' => CAP_ALLOW
2431
        ),
2432
    ),
2433
    'moodle/competency:templateview' => array(
2434
        'captype' => 'read',
2435
        'contextlevel' => CONTEXT_COURSECAT,
2436
        'archetypes' => array(
2437
            'manager' => CAP_ALLOW
2438
        ),
2439
    ),
2440
    // User evidence.
2441
    'moodle/competency:userevidencemanage' => array(
2442
        'captype' => 'write',
2443
        'contextlevel' => CONTEXT_USER,
2444
        'archetypes' => array(
2445
            'manager' => CAP_ALLOW
2446
        ),
2447
    ),
2448
    'moodle/competency:userevidencemanageown' => array(
2449
        'captype' => 'write',
2450
        'contextlevel' => CONTEXT_USER,
2451
        'archetypes' => array(
2452
            'user' => CAP_ALLOW
2453
        ),
2454
    ),
2455
    'moodle/competency:userevidenceview' => array(
2456
        'captype' => 'read',
2457
        'contextlevel' => CONTEXT_USER,
2458
        'archetypes' => array(
2459
            'manager' => CAP_ALLOW
2460
        ),
2461
    ),
2462
    'moodle/site:maintenanceaccess' => array(
2463
        'captype' => 'write',
2464
        'contextlevel' => CONTEXT_SYSTEM,
2465
        'archetypes' => array(
2466
        )
2467
    ),
2468
    // Allow message any user, regardlesss of the privacy preferences for messaging.
2469
    'moodle/site:messageanyuser' => array(
2470
        'riskbitmask' => RISK_SPAM,
2471
        'captype' => 'write',
2472
        'contextlevel' => CONTEXT_SYSTEM,
2473
        'archetypes' => array(
2474
            'teacher' => CAP_ALLOW,
2475
            'editingteacher' => CAP_ALLOW,
2476
            'manager' => CAP_ALLOW
2477
        )
2478
    ),
2479
 
2480
    // Context locking/unlocking.
2481
    'moodle/site:managecontextlocks' => [
2482
        'captype' => 'write',
2483
        'contextlevel' => CONTEXT_MODULE,
2484
        'archetypes' => [
2485
        ],
2486
    ],
2487
 
2488
    // Manual completion toggling.
2489
    'moodle/course:togglecompletion' => [
2490
        'captype' => 'write',
2491
        'contextlevel' => CONTEXT_MODULE,
2492
        'archetypes' => [
2493
            'user' => CAP_ALLOW,
2494
        ],
2495
    ],
2496
 
2497
    'moodle/analytics:listowninsights' => array(
2498
        'captype' => 'read',
2499
        'contextlevel' => CONTEXT_SYSTEM,
2500
        'archetypes' => array(
2501
            'user' => CAP_ALLOW
2502
        )
2503
    ),
2504
 
2505
    // Set display option buttons to an H5P content.
2506
    'moodle/h5p:setdisplayoptions' => array(
2507
        'captype' => 'write',
2508
        'contextlevel' => CONTEXT_MODULE,
2509
        'archetypes' => array(
2510
            'editingteacher' => CAP_ALLOW,
2511
        )
2512
    ),
2513
 
2514
    // Allow to deploy H5P content.
2515
    'moodle/h5p:deploy' => array(
2516
        'riskbitmask' => RISK_XSS,
2517
        'captype' => 'write',
2518
        'contextlevel' => CONTEXT_MODULE,
2519
        'archetypes' => array(
2520
            'manager'        => CAP_ALLOW,
2521
            'editingteacher' => CAP_ALLOW,
2522
        )
2523
    ),
2524
 
2525
    // Allow to update H5P content-type libraries.
2526
    'moodle/h5p:updatelibraries' => [
2527
        'riskbitmask' => RISK_XSS,
2528
        'captype' => 'write',
2529
        'contextlevel' => CONTEXT_MODULE,
2530
        'archetypes' => [
2531
            'manager' => CAP_ALLOW,
2532
        ]
2533
    ],
2534
 
2535
    // Allow users to recommend activities in the activity chooser.
2536
    'moodle/course:recommendactivity' => [
2537
        'captype' => 'write',
2538
        'contextlevel' => CONTEXT_SYSTEM,
2539
        'archetypes' => [
2540
            'manager' => CAP_ALLOW,
2541
        ]
2542
    ],
2543
 
2544
    // Content bank capabilities.
2545
    'moodle/contentbank:access' => array(
2546
        'captype' => 'read',
2547
        'contextlevel' => CONTEXT_COURSE,
2548
        'archetypes' => array(
2549
            'manager' => CAP_ALLOW,
2550
            'coursecreator' => CAP_ALLOW,
2551
            'editingteacher' => CAP_ALLOW,
2552
        )
2553
    ),
2554
 
2555
    'moodle/contentbank:upload' => array(
2556
        'riskbitmask' => RISK_SPAM,
2557
        'captype' => 'write',
2558
        'contextlevel' => CONTEXT_COURSE,
2559
        'archetypes' => array(
2560
            'manager' => CAP_ALLOW,
2561
            'coursecreator' => CAP_ALLOW,
2562
            'editingteacher' => CAP_ALLOW,
2563
        )
2564
    ),
2565
 
2566
    // Delete any content from the content bank.
2567
    'moodle/contentbank:deleteanycontent' => [
2568
        'riskbitmask' => RISK_DATALOSS,
2569
        'captype' => 'write',
2570
        'contextlevel' => CONTEXT_COURSE,
2571
        'archetypes' => [
2572
            'manager' => CAP_ALLOW,
2573
            'coursecreator' => CAP_ALLOW,
2574
        ]
2575
    ],
2576
 
2577
    // Delete content created by yourself.
2578
    'moodle/contentbank:deleteowncontent' => [
2579
        'captype' => 'write',
2580
        'contextlevel' => CONTEXT_COURSE,
2581
        'archetypes' => [
2582
            'user' => CAP_ALLOW,
2583
        ]
2584
    ],
2585
 
2586
    // Manage (rename, move, publish, share, etc.) any content from the content bank.
2587
    'moodle/contentbank:manageanycontent' => [
2588
        'riskbitmask' => RISK_DATALOSS,
2589
        'captype' => 'write',
2590
        'contextlevel' => CONTEXT_COURSE,
2591
        'archetypes' => array(
2592
            'manager' => CAP_ALLOW,
2593
            'coursecreator' => CAP_ALLOW,
2594
        )
2595
    ],
2596
 
2597
    // Manage (rename, move, publish, share, etc.) content created by yourself.
2598
    'moodle/contentbank:manageowncontent' => [
2599
        'captype' => 'write',
2600
        'contextlevel' => CONTEXT_COURSE,
2601
        'archetypes' => array(
2602
            'manager' => CAP_ALLOW,
2603
            'coursecreator' => CAP_ALLOW,
2604
            'editingteacher' => CAP_ALLOW,
2605
        )
2606
    ],
2607
 
2608
    // Allow users to create/edit content within the content bank.
2609
    'moodle/contentbank:useeditor' => [
2610
        'riskbitmask' => RISK_SPAM,
2611
        'captype' => 'write',
2612
        'contextlevel' => CONTEXT_COURSE,
2613
        'archetypes' => array(
2614
            'manager' => CAP_ALLOW,
2615
            'coursecreator' => CAP_ALLOW,
2616
            'editingteacher' => CAP_ALLOW,
2617
        )
2618
    ],
2619
 
2620
    // Allow users to download content.
2621
    'moodle/contentbank:downloadcontent' => [
2622
        'captype' => 'read',
2623
        'contextlevel' => CONTEXT_COURSE,
2624
        'archetypes' => [
2625
            'manager' => CAP_ALLOW,
2626
            'coursecreator' => CAP_ALLOW,
2627
            'editingteacher' => CAP_ALLOW,
2628
        ]
2629
    ],
2630
 
2631
    // Allow users to copy content.
2632
    'moodle/contentbank:copyanycontent' => [
2633
        'riskbitmask' => RISK_SPAM,
2634
        'captype' => 'write',
2635
        'contextlevel' => CONTEXT_COURSE,
2636
        'archetypes' => [
2637
            'manager' => CAP_ALLOW,
2638
            'coursecreator' => CAP_ALLOW,
2639
        ]
2640
    ],
2641
 
2642
    // Allow users to copy content.
2643
    'moodle/contentbank:copycontent' => [
2644
        'riskbitmask' => RISK_SPAM,
2645
        'captype' => 'write',
2646
        'contextlevel' => CONTEXT_COURSE,
2647
        'archetypes' => [
2648
            'manager' => CAP_ALLOW,
2649
            'coursecreator' => CAP_ALLOW,
2650
            'editingteacher' => CAP_ALLOW,
2651
        ]
2652
    ],
2653
 
1441 ariadna 2654
    'moodle/contentbank:configurecustomfields' => [
2655
        'riskbitmask' => RISK_SPAM,
2656
        'captype' => 'write',
2657
        'contextlevel' => CONTEXT_COURSE,
2658
        'archetypes' => [
2659
            'manager' => CAP_ALLOW,
2660
        ],
2661
    ],
2662
 
2663
    'moodle/contentbank:changelockedcustomfields' => [
2664
        'riskbitmask' => RISK_SPAM,
2665
        'captype' => 'write',
2666
        'contextlevel' => CONTEXT_COURSE,
2667
        'archetypes' => [
2668
            'manager' => CAP_ALLOW,
2669
        ],
2670
    ],
2671
 
1 efrain 2672
    // Allow users to download course content.
2673
    'moodle/course:downloadcoursecontent' => [
2674
        'captype' => 'read',
2675
        'contextlevel' => CONTEXT_COURSE,
2676
        'archetypes' => array(
2677
            'student' => CAP_ALLOW,
2678
            'teacher' => CAP_ALLOW,
2679
            'editingteacher' => CAP_ALLOW,
2680
            'manager' => CAP_ALLOW
2681
        )
2682
    ],
2683
 
2684
    // Allow users to configure download course content functionality within a course, if the feature is available.
2685
    'moodle/course:configuredownloadcontent' => [
2686
        'captype' => 'write',
2687
        'contextlevel' => CONTEXT_COURSE,
2688
        'archetypes' => array(
2689
            'editingteacher' => CAP_ALLOW,
2690
            'manager' => CAP_ALLOW
2691
        ),
2692
    ],
2693
 
2694
    // Allow to manage payment accounts.
2695
    'moodle/payment:manageaccounts' => [
2696
        'captype' => 'write',
2697
        'riskbitmask' => RISK_PERSONAL | RISK_CONFIG | RISK_DATALOSS,
2698
        'contextlevel' => CONTEXT_COURSE,
2699
        'archetypes' => [],
2700
    ],
2701
 
2702
    // Allow to view payments.
2703
    'moodle/payment:viewpayments' => [
2704
        'captype' => 'read',
2705
        'riskbitmask' => RISK_PERSONAL,
2706
        'contextlevel' => CONTEXT_COURSE,
2707
        'archetypes' => [],
2708
    ],
2709
 
2710
    // Allow users to view hidden content.
2711
    'moodle/contentbank:viewunlistedcontent' => [
2712
        'captype' => 'read',
2713
        'contextlevel' => CONTEXT_COURSE,
2714
        'archetypes' => [
2715
            'manager' => CAP_ALLOW,
2716
            'coursecreator' => CAP_ALLOW,
2717
        ]
2718
    ],
2719
 
2720
    // Allow users to view custom reports.
2721
    'moodle/reportbuilder:view' => [
2722
        'captype' => 'read',
2723
        'contextlevel' => CONTEXT_SYSTEM,
2724
        'archetypes' => [
2725
            'user' => CAP_ALLOW,
2726
        ],
2727
    ],
2728
 
2729
    // Allow users to view all custom reports.
2730
    'moodle/reportbuilder:viewall' => [
2731
        'captype' => 'read',
2732
        'contextlevel' => CONTEXT_SYSTEM,
2733
        'archetypes' => [],
2734
    ],
2735
 
2736
    // Allow users to create/edit their own custom reports.
2737
    'moodle/reportbuilder:edit' => [
2738
        'captype' => 'write',
2739
        'riskbitmap' => RISK_PERSONAL,
2740
        'contextlevel' => CONTEXT_SYSTEM,
2741
        'archetypes' => [
2742
            'manager' => CAP_ALLOW,
2743
        ],
2744
    ],
2745
 
2746
    // Allow users to create/edit all custom reports.
2747
    'moodle/reportbuilder:editall' => [
2748
        'captype' => 'write',
2749
        'riskbitmap' => RISK_PERSONAL,
2750
        'contextlevel' => CONTEXT_SYSTEM,
2751
        'archetypes' => [],
2752
    ],
2753
 
1441 ariadna 2754
    // Allow users to configure custom fields for custom reports.
2755
    'moodle/reportbuilder:configurecustomfields' => [
2756
        'captype' => 'write',
2757
        'riskbitmap' => RISK_PERSONAL,
2758
        'contextlevel' => CONTEXT_SYSTEM,
2759
        'archetypes' => [],
2760
    ],
2761
 
1 efrain 2762
    // Allow users to schedule reports as other users.
2763
    'moodle/reportbuilder:scheduleviewas' => [
2764
        'captype' => 'read',
2765
        'riskbitmap' => RISK_PERSONAL,
2766
        'contextlevel' => CONTEXT_SYSTEM,
2767
        'archetypes' => [],
2768
    ],
2769
 
2770
    // Allow users to share activities to MoodleNet.
2771
    'moodle/moodlenet:shareactivity' => [
2772
        'captype' => 'read',
2773
        'contextlevel' => CONTEXT_COURSE,
2774
        'archetypes' => [
2775
            'editingteacher' => CAP_ALLOW,
2776
            'manager' => CAP_ALLOW,
2777
        ]
2778
    ],
2779
 
2780
    // Allow users to configure course communication rooms.
2781
    'moodle/course:configurecoursecommunication' => [
2782
        'captype' => 'write',
2783
        'contextlevel' => CONTEXT_COURSE,
2784
        'archetypes' => [
2785
            'editingteacher' => CAP_ALLOW,
2786
            'manager' => CAP_ALLOW,
2787
        ]
2788
    ],
2789
 
2790
    // Allow users to share courses to MoodleNet.
2791
    'moodle/moodlenet:sharecourse' => [
2792
        'captype' => 'read',
2793
        'contextlevel' => CONTEXT_COURSE,
2794
        'archetypes' => [
2795
            'editingteacher' => CAP_ALLOW,
2796
            'manager' => CAP_ALLOW,
2797
        ]
2798
    ],
1441 ariadna 2799
 
2800
    // Allow users to edit course welcome messages.
2801
    'moodle/course:editcoursewelcomemessage' => [
2802
        'captype' => 'write',
2803
        'contextlevel' => CONTEXT_COURSE,
2804
        'archetypes' => [
2805
            'editingteacher' => CAP_ALLOW,
2806
            'manager' => CAP_ALLOW,
2807
        ],
2808
    ],
2809
 
2810
    // Set a users acceptance of the AI policy.
2811
    'moodle/ai:fetchanyuserpolicystatus' => [
2812
        'captype' => 'write',
2813
        'contextlevel' => CONTEXT_SYSTEM,
2814
        'archetypes' => [
2815
            'user' => CAP_ALLOW,
2816
        ],
2817
    ],
2818
    // Set a users acceptance of the AI policy.
2819
    'moodle/ai:acceptpolicy' => [
2820
        'captype' => 'write',
2821
        'contextlevel' => CONTEXT_SYSTEM,
2822
        'archetypes' => [
2823
            'user' => CAP_ALLOW,
2824
        ],
2825
    ],
2826
    // Get a users acceptance of the AI policy.
2827
    'moodle/ai:fetchpolicy' => [
2828
        'captype' => 'read',
2829
        'contextlevel' => CONTEXT_SYSTEM,
2830
        'archetypes' => [
2831
            'user' => CAP_ALLOW,
2832
        ],
2833
    ],
2834
    // Allow managers to view the AI policy acceptance report.
2835
    'moodle/ai:viewaipolicyacceptancereport' => [
2836
        'riskbitmask' => RISK_PERSONAL,
2837
        'captype' => 'read',
2838
        'contextlevel' => CONTEXT_SYSTEM,
2839
        'archetypes' => [
2840
            'manager' => CAP_ALLOW,
2841
        ],
2842
    ],
2843
    // Allow managers to view the AI usage report.
2844
    'moodle/ai:viewaiusagereport' => [
2845
        'riskbitmask' => RISK_PERSONAL,
2846
        'captype' => 'read',
2847
        'contextlevel' => CONTEXT_SYSTEM,
2848
        'archetypes' => [
2849
            'manager' => CAP_ALLOW,
2850
        ],
2851
    ],
1 efrain 2852
);