MDL-66213 roles: review new site:viewanonymousevents capability
[moodle.git] / lib / db / access.php
CommitLineData
117bd748 1<?php
5b4a78e2 2// This file is part of Moodle - http://moodle.org/
bbbf2d40 3//
5b4a78e2
PS
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.
bbbf2d40 8//
5b4a78e2
PS
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.
bbbf2d40 13//
5b4a78e2
PS
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 *
39b90b51
EL
45 * For more information, take a look to the documentation available:
46 * - Access API: {@link http://docs.moodle.org/dev/Access_API}
47 * - Upgrade API: {@link http://docs.moodle.org/dev/Upgrade_API}
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
5b4a78e2 53 */
bbbf2d40 54
5b4a78e2 55defined('MOODLE_INTERNAL') || die();
bbbf2d40 56
0ac940b3 57$capabilities = array(
bbbf2d40 58 'moodle/site:config' => array(
eef868d1 59
f432bebf 60 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG | RISK_DATALOSS,
21b6db6e 61
bbbf2d40 62 'captype' => 'write',
63 'contextlevel' => CONTEXT_SYSTEM,
31c93303 64 'archetypes' => array(
bbbf2d40 65 )
66 ),
2a7c540c
DW
67 'moodle/site:configview' => array(
68 'captype' => 'read',
69 'contextlevel' => CONTEXT_SYSTEM,
70 'archetypes' => array(
71 'manager' => CAP_ALLOW,
b1eb88a4 72 'coursecreator' => CAP_ALLOW,
2a7c540c
DW
73 )
74 ),
eef868d1 75
51792df0 76 'moodle/site:readallmessages' => array(
eef868d1 77
bcdb0f19 78 'riskbitmask' => RISK_PERSONAL,
79
51792df0 80 'captype' => 'read',
81 'contextlevel' => CONTEXT_SYSTEM,
31c93303 82 'archetypes' => array(
4f0c2d00 83 'manager' => CAP_ALLOW,
4b7ae3c4 84 'editingteacher' => CAP_ALLOW
51792df0 85 )
86 ),
f7c0d84b 87
343ba16c
SL
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
45823085
MN
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
576ad290 110 'moodle/site:sendmessage' => array(
111
3a0c6cca 112 'riskbitmask' => RISK_SPAM,
576ad290 113
114 'captype' => 'write',
115 'contextlevel' => CONTEXT_SYSTEM,
31c93303 116 'archetypes' => array(
4f0c2d00 117 'manager' => CAP_ALLOW,
576ad290 118 'user' => CAP_ALLOW
119 )
f7c0d84b 120 ),
eef868d1 121
45823085
MN
122 'moodle/site:deleteownmessage' => array(
123
124 'captype' => 'write',
125 'contextlevel' => CONTEXT_SYSTEM,
126 'archetypes' => array(
127 'user' => CAP_ALLOW
128 )
129 ),
130
51792df0 131 'moodle/site:approvecourse' => array(
eef868d1 132
bcdb0f19 133 'riskbitmask' => RISK_XSS,
134
51792df0 135 'captype' => 'write',
3e15abe5 136 'contextlevel' => CONTEXT_COURSECAT,
31c93303 137 'archetypes' => array(
4f0c2d00 138 'manager' => CAP_ALLOW
51792df0 139 )
140 ),
eef868d1 141
d2940003 142 'moodle/backup:backupcourse' => array(
eef868d1 143
21b6db6e 144 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
145
bbbf2d40 146 'captype' => 'write',
f432bebf 147 'contextlevel' => CONTEXT_COURSE,
31c93303 148 'archetypes' => array(
7246585a 149 'editingteacher' => CAP_ALLOW,
4f0c2d00 150 'manager' => CAP_ALLOW
d2940003
EL
151 ),
152
153 'clonepermissionsfrom' => 'moodle/site:backup'
bbbf2d40 154 ),
eef868d1 155
57ca97b3
EL
156 'moodle/backup:backupsection' => array(
157
158 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
159
160 'captype' => 'write',
161 'contextlevel' => CONTEXT_COURSE,
31c93303 162 'archetypes' => array(
57ca97b3
EL
163 'editingteacher' => CAP_ALLOW,
164 'manager' => CAP_ALLOW
165 ),
166
167 'clonepermissionsfrom' => 'moodle/backup:backupcourse'
168 ),
169
170 'moodle/backup:backupactivity' => array(
171
172 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
173
174 'captype' => 'write',
175 'contextlevel' => CONTEXT_MODULE,
31c93303 176 'archetypes' => array(
57ca97b3
EL
177 'editingteacher' => CAP_ALLOW,
178 'manager' => CAP_ALLOW
179 ),
180
181 'clonepermissionsfrom' => 'moodle/backup:backupcourse'
182 ),
183
57ca97b3
EL
184 'moodle/backup:backuptargetimport' => array(
185
186 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
187
188 'captype' => 'write',
189 'contextlevel' => CONTEXT_COURSE,
31c93303 190 'archetypes' => array(
57ca97b3
EL
191 'editingteacher' => CAP_ALLOW,
192 'manager' => CAP_ALLOW
193 ),
194
195 'clonepermissionsfrom' => 'moodle/backup:backupcourse'
196 ),
197
2fdde5d1 198 'moodle/backup:downloadfile' => array(
172dd12c 199
200 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
201
202 'captype' => 'write',
203 'contextlevel' => CONTEXT_COURSE,
31c93303 204 'archetypes' => array(
172dd12c 205 'editingteacher' => CAP_ALLOW,
4f0c2d00 206 'manager' => CAP_ALLOW
172dd12c 207 ),
208
2fdde5d1 209 'clonepermissionsfrom' => 'moodle/site:backupdownload'
172dd12c 210 ),
211
57ca97b3
EL
212 'moodle/backup:configure' => array(
213
214 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
215
216 'captype' => 'write',
217 'contextlevel' => CONTEXT_COURSE,
31c93303 218 'archetypes' => array(
57ca97b3
EL
219 'editingteacher' => CAP_ALLOW,
220 'manager' => CAP_ALLOW
221 )
222 ),
223
2fdde5d1 224 'moodle/backup:userinfo' => array(
172dd12c 225
2fdde5d1 226 'riskbitmask' => RISK_PERSONAL,
172dd12c 227
2fdde5d1 228 'captype' => 'read',
172dd12c 229 'contextlevel' => CONTEXT_COURSE,
31c93303 230 'archetypes' => array(
4f0c2d00 231 'manager' => CAP_ALLOW
2fdde5d1 232 )
172dd12c 233 ),
234
57ca97b3
EL
235 'moodle/backup:anonymise' => array(
236
237 'riskbitmask' => RISK_PERSONAL,
238
239 'captype' => 'read',
240 'contextlevel' => CONTEXT_COURSE,
31c93303 241 'archetypes' => array(
57ca97b3
EL
242 'manager' => CAP_ALLOW
243 )
244 ),
245
2fdde5d1 246 'moodle/restore:restorecourse' => array(
f2a0da6c 247
2fdde5d1 248 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
f2a0da6c 249
2fdde5d1 250 'captype' => 'write',
f2a0da6c 251 'contextlevel' => CONTEXT_COURSE,
31c93303 252 'archetypes' => array(
2fdde5d1 253 'editingteacher' => CAP_ALLOW,
4f0c2d00 254 'manager' => CAP_ALLOW
2fdde5d1
EL
255 ),
256
257 'clonepermissionsfrom' => 'moodle/site:restore'
f2a0da6c
EL
258 ),
259
57ca97b3
EL
260 'moodle/restore:restoresection' => array(
261
262 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
263
264 'captype' => 'write',
265 'contextlevel' => CONTEXT_COURSE,
31c93303 266 'archetypes' => array(
57ca97b3
EL
267 'editingteacher' => CAP_ALLOW,
268 'manager' => CAP_ALLOW
269 ),
270
271 'clonepermissionsfrom' => 'moodle/restore:restorecourse'
272 ),
273
274 'moodle/restore:restoreactivity' => array(
275
276 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
277
278 'captype' => 'write',
7efd488e 279 'contextlevel' => CONTEXT_COURSE,
31c93303 280 'archetypes' => array(
57ca97b3
EL
281 'editingteacher' => CAP_ALLOW,
282 'manager' => CAP_ALLOW
283 ),
284
285 'clonepermissionsfrom' => 'moodle/restore:restorecourse'
286 ),
287
bac233d3
SH
288 'moodle/restore:viewautomatedfilearea' => array(
289
290 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
291
292 'captype' => 'write',
293 'contextlevel' => CONTEXT_COURSE,
54945fa7
JD
294 'archetypes' => array(
295 'editingteacher' => CAP_ALLOW,
296 'manager' => CAP_ALLOW
297 ),
bac233d3
SH
298 ),
299
157aa3a2 300 'moodle/restore:restoretargetimport' => array(
eef868d1 301
21b6db6e 302 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
303
bbbf2d40 304 'captype' => 'write',
f432bebf 305 'contextlevel' => CONTEXT_COURSE,
31c93303 306 'archetypes' => array(
7246585a 307 'editingteacher' => CAP_ALLOW,
4f0c2d00 308 'manager' => CAP_ALLOW
d2940003
EL
309 ),
310
157aa3a2 311 'clonepermissionsfrom' => 'moodle/site:import'
bbbf2d40 312 ),
eef868d1 313
157aa3a2 314 'moodle/restore:uploadfile' => array(
5e934890 315
157aa3a2 316 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
5e934890
EL
317
318 'captype' => 'write',
157aa3a2 319 'contextlevel' => CONTEXT_COURSE,
31c93303 320 'archetypes' => array(
157aa3a2 321 'editingteacher' => CAP_ALLOW,
4f0c2d00 322 'manager' => CAP_ALLOW
157aa3a2
EL
323 ),
324
325 'clonepermissionsfrom' => 'moodle/site:backupupload'
5e934890
EL
326 ),
327
57ca97b3 328 'moodle/restore:configure' => array(
f6459d12 329
57ca97b3 330 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
f6459d12
EL
331
332 'captype' => 'write',
333 'contextlevel' => CONTEXT_COURSE,
31c93303 334 'archetypes' => array(
57ca97b3 335 'editingteacher' => CAP_ALLOW,
4f0c2d00 336 'manager' => CAP_ALLOW
f6459d12
EL
337 )
338 ),
339
57ca97b3 340 'moodle/restore:rolldates' => array(
157aa3a2
EL
341
342 'captype' => 'write',
57ca97b3 343 'contextlevel' => CONTEXT_COURSE,
31c93303 344 'archetypes' => array(
57ca97b3 345 'coursecreator' => CAP_ALLOW,
4f0c2d00 346 'manager' => CAP_ALLOW
157aa3a2
EL
347 )
348 ),
349
57ca97b3
EL
350 'moodle/restore:userinfo' => array(
351
352 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
982e45af 353
354 'captype' => 'write',
355 'contextlevel' => CONTEXT_COURSE,
31c93303 356 'archetypes' => array(
57ca97b3
EL
357 'manager' => CAP_ALLOW
358 )
359 ),
360
361 'moodle/restore:createuser' => array(
362
363 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
364
365 'captype' => 'write',
366 'contextlevel' => CONTEXT_SYSTEM,
31c93303 367 'archetypes' => array(
4f0c2d00 368 'manager' => CAP_ALLOW
982e45af 369 )
370 ),
371
bbbf2d40 372 'moodle/site:manageblocks' => array(
eef868d1 373
21b6db6e 374 'riskbitmask' => RISK_SPAM | RISK_XSS,
375
bbbf2d40 376 'captype' => 'write',
f432bebf 377 'contextlevel' => CONTEXT_BLOCK,
31c93303 378 'archetypes' => array(
73b73d21 379 'editingteacher' => CAP_ALLOW,
4f0c2d00 380 'manager' => CAP_ALLOW
bbbf2d40 381 )
382 ),
eef868d1 383
27950688 384 'moodle/site:accessallgroups' => array(
eef868d1 385
27950688 386 'captype' => 'read',
939218c2 387 'contextlevel' => CONTEXT_MODULE,
31c93303 388 'archetypes' => array(
27950688 389 'editingteacher' => CAP_ALLOW,
4f0c2d00 390 'manager' => CAP_ALLOW
27950688 391 )
392 ),
eef868d1 393
50cc80fd
DB
394 'moodle/site:viewanonymousevents' => array(
395
1962f743
SA
396 'riskbitmask' => RISK_PERSONAL,
397
50cc80fd
DB
398 'captype' => 'read',
399 'contextlevel' => CONTEXT_MODULE,
400 'archetypes' => array(
1962f743 401 'manager' => CAP_ALLOW,
50cc80fd
DB
402 )
403 ),
404
53d7785b 405 'moodle/site:viewfullnames' => array(
eef868d1 406
53d7785b 407 'captype' => 'read',
939218c2 408 'contextlevel' => CONTEXT_MODULE,
31c93303 409 'archetypes' => array(
53d7785b 410 'teacher' => CAP_ALLOW,
411 'editingteacher' => CAP_ALLOW,
4f0c2d00 412 'manager' => CAP_ALLOW
53d7785b 413 )
414 ),
eef868d1 415
5c60a847 416 // In reports that give lists of users, extra information about each user's
417 // identity (the fields configured in site option showuseridentity) will be
418 // displayed to users who have this capability.
419 'moodle/site:viewuseridentity' => array(
420
421 'captype' => 'read',
939218c2 422 'contextlevel' => CONTEXT_MODULE,
5c60a847 423 'archetypes' => array(
424 'teacher' => CAP_ALLOW,
425 'editingteacher' => CAP_ALLOW,
426 'manager' => CAP_ALLOW
427 )
428 ),
429
a028c291 430 'moodle/site:viewreports' => array(
eef868d1 431
21b6db6e 432 'riskbitmask' => RISK_PERSONAL,
433
a028c291 434 'captype' => 'read',
f432bebf 435 'contextlevel' => CONTEXT_COURSE,
31c93303 436 'archetypes' => array(
a028c291 437 'teacher' => CAP_ALLOW,
438 'editingteacher' => CAP_ALLOW,
4f0c2d00 439 'manager' => CAP_ALLOW
a028c291 440 )
441 ),
eef868d1 442
7d8a3cb0 443 'moodle/site:trustcontent' => array(
eef868d1 444
21b6db6e 445 'riskbitmask' => RISK_XSS,
446
7d8a3cb0 447 'captype' => 'write',
939218c2 448 'contextlevel' => CONTEXT_MODULE,
31c93303 449 'archetypes' => array(
7d8a3cb0 450 'editingteacher' => CAP_ALLOW,
4f0c2d00 451 'manager' => CAP_ALLOW
7d8a3cb0 452 )
453 ),
eef868d1 454
6df3c7df 455 'moodle/site:uploadusers' => array(
eef868d1 456
21b6db6e 457 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
458
bbbf2d40 459 'captype' => 'write',
460 'contextlevel' => CONTEXT_SYSTEM,
31c93303 461 'archetypes' => array(
4f0c2d00 462 'manager' => CAP_ALLOW
bbbf2d40 463 )
464 ),
eef868d1 465
94211250 466 // Permission to manage filter setting overrides in subcontexts.
467 'moodle/filter:manage' => array(
468
469 'captype' => 'write',
470 'contextlevel' => CONTEXT_COURSE,
31c93303 471 'archetypes' => array(
94211250 472 'editingteacher' => CAP_ALLOW,
4f0c2d00 473 'manager' => CAP_ALLOW,
94211250 474 )
475 ),
6df3c7df 476
477 'moodle/user:create' => array(
478
479 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
eef868d1 480
bbbf2d40 481 'captype' => 'write',
482 'contextlevel' => CONTEXT_SYSTEM,
31c93303 483 'archetypes' => array(
4f0c2d00 484 'manager' => CAP_ALLOW
bbbf2d40 485 )
486 ),
eef868d1 487
6df3c7df 488 'moodle/user:delete' => array(
cc891abe 489
9c064d03 490 'riskbitmask' => RISK_PERSONAL | RISK_DATALOSS,
bcdb0f19 491
cc891abe 492 'captype' => 'write',
493 'contextlevel' => CONTEXT_SYSTEM,
31c93303 494 'archetypes' => array(
4f0c2d00 495 'manager' => CAP_ALLOW
cc891abe 496 )
497 ),
498
6df3c7df 499 'moodle/user:update' => array(
cc891abe 500
501 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
21b6db6e 502
bbbf2d40 503 'captype' => 'write',
504 'contextlevel' => CONTEXT_SYSTEM,
31c93303 505 'archetypes' => array(
4f0c2d00 506 'manager' => CAP_ALLOW
bbbf2d40 507 )
508 ),
eef868d1 509
bbbf2d40 510 'moodle/user:viewdetails' => array(
eef868d1 511
e58eca72 512 'captype' => 'read',
f432bebf 513 'contextlevel' => CONTEXT_COURSE,
31c93303 514 'archetypes' => array(
22ae509e 515 'guest' => CAP_ALLOW,
516 'student' => CAP_ALLOW,
517 'teacher' => CAP_ALLOW,
518 'editingteacher' => CAP_ALLOW,
4f0c2d00 519 'manager' => CAP_ALLOW
bbbf2d40 520 )
521 ),
e58eca72 522
6d153e67 523 'moodle/user:viewalldetails' => array(
524 'riskbitmask' => RISK_PERSONAL,
525 'captype' => 'read',
526 'contextlevel' => CONTEXT_USER,
527 'archetypes' => array(
528 'manager' => CAP_ALLOW
529 ),
530 'clonepermissionsfrom' => 'moodle/user:update'
531 ),
532
9d9361e8
DNA
533 'moodle/user:viewlastip' => array(
534 'riskbitmask' => RISK_PERSONAL,
535 'captype' => 'read',
536 'contextlevel' => CONTEXT_USER,
537 'archetypes' => array(
538 'manager' => CAP_ALLOW
539 ),
540 'clonepermissionsfrom' => 'moodle/user:update'
541 ),
542
e58eca72 543 'moodle/user:viewhiddendetails' => array(
eef868d1 544
21b6db6e 545 'riskbitmask' => RISK_PERSONAL,
546
e58eca72 547 'captype' => 'read',
f432bebf 548 'contextlevel' => CONTEXT_COURSE,
31c93303 549 'archetypes' => array(
e58eca72 550 'teacher' => CAP_ALLOW,
551 'editingteacher' => CAP_ALLOW,
4f0c2d00 552 'manager' => CAP_ALLOW
e58eca72 553 )
554 ),
eef868d1 555
6c95827f 556 'moodle/user:loginas' => array(
557
558 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
559
560 'captype' => 'write',
561 'contextlevel' => CONTEXT_COURSE,
31c93303 562 'archetypes' => array(
4f0c2d00 563 'manager' => CAP_ALLOW
6c95827f 564 )
565 ),
566
03d9401e
MD
567 // can the user manage the system default profile page?
568 'moodle/user:managesyspages' => array(
569
570 'riskbitmap' => RISK_SPAM | RISK_PERSONAL | RISK_CONFIG,
571
572 'captype' => 'write',
573 'contextlevel' => CONTEXT_SYSTEM,
31c93303 574 'archetypes' => array(
03d9401e
MD
575 'manager' => CAP_ALLOW
576 )
577 ),
578
579 // can the user manage another user's profile page?
580 'moodle/user:manageblocks' => array(
581
582 'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
583
584 'captype' => 'write',
585 'contextlevel' => CONTEXT_USER
586 ),
587
588 // can the user manage their own profile page?
589 'moodle/user:manageownblocks' => array(
590
591 'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
592
593 'captype' => 'write',
594 'contextlevel' => CONTEXT_SYSTEM,
31c93303 595 'archetypes' => array(
e4f413b4
MD
596 'user' => CAP_ALLOW
597 )
598 ),
599
600 // can the user manage their own files?
601 'moodle/user:manageownfiles' => array(
602
603 'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
604
605 'captype' => 'write',
606 'contextlevel' => CONTEXT_SYSTEM,
607 'archetypes' => array(
608 'user' => CAP_ALLOW
03d9401e
MD
609 )
610 ),
611
380c122f
FM
612 // Can the user ignore the setting userquota?
613 // The permissions are cloned from ignorefilesizelimits as it was partly used for that purpose.
614 'moodle/user:ignoreuserquota' => array(
615 'riskbitmap' => RISK_SPAM,
616 'captype' => 'write',
617 'contextlevel' => CONTEXT_SYSTEM,
618 'clonepermissionsfrom' => 'moodle/course:ignorefilesizelimits'
619 ),
620
03d9401e
MD
621 // can the user manage the system default dashboard page?
622 'moodle/my:configsyspages' => array(
623
624 'riskbitmap' => RISK_SPAM | RISK_PERSONAL | RISK_CONFIG,
625
626 'captype' => 'write',
627 'contextlevel' => CONTEXT_SYSTEM,
31c93303 628 'archetypes' => array(
03d9401e
MD
629 'manager' => CAP_ALLOW
630 )
631 ),
632
bbbf2d40 633 'moodle/role:assign' => array(
eef868d1 634
3a0c6cca 635 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
636
bbbf2d40 637 'captype' => 'write',
f432bebf 638 'contextlevel' => CONTEXT_COURSE,
31c93303 639 'archetypes' => array(
861fdcaa 640 'editingteacher' => CAP_ALLOW,
4f0c2d00 641 'manager' => CAP_ALLOW
68c52526 642 )
643 ),
eef868d1 644
01a2ce80
PS
645 'moodle/role:review' => array(
646
647 'riskbitmask' => RISK_PERSONAL,
648
649 'captype' => 'read',
650 'contextlevel' => CONTEXT_COURSE,
31c93303 651 'archetypes' => array(
01a2ce80
PS
652 'teacher' => CAP_ALLOW,
653 'editingteacher' => CAP_ALLOW,
4f0c2d00 654 'manager' => CAP_ALLOW
01a2ce80
PS
655 )
656 ),
657
68c52526 658 'moodle/role:override' => array(
eef868d1 659
bcdb0f19 660 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
661
68c52526 662 'captype' => 'write',
f432bebf 663 'contextlevel' => CONTEXT_COURSE,
31c93303 664 'archetypes' => array(
4f0c2d00 665 'manager' => CAP_ALLOW
bbbf2d40 666 )
667 ),
eef868d1 668
3a0c6cca 669 'moodle/role:safeoverride' => array(
670
671 'riskbitmask' => RISK_SPAM,
672
673 'captype' => 'write',
f432bebf 674 'contextlevel' => CONTEXT_COURSE,
31c93303 675 'archetypes' => array(
3a0c6cca 676 'editingteacher' => CAP_ALLOW
677 )
678 ),
679
bbbf2d40 680 'moodle/role:manage' => array(
eef868d1 681
bcdb0f19 682 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
683
bbbf2d40 684 'captype' => 'write',
685 'contextlevel' => CONTEXT_SYSTEM,
31c93303 686 'archetypes' => array(
4f0c2d00 687 'manager' => CAP_ALLOW
bbbf2d40 688 )
689 ),
f43ce1ad 690
20dd4cf5 691 'moodle/role:switchroles' => array(
bcdb0f19 692
3a0c6cca 693 'riskbitmask' => RISK_XSS | RISK_PERSONAL,
bcdb0f19 694
20dd4cf5 695 'captype' => 'read',
f432bebf 696 'contextlevel' => CONTEXT_COURSE,
31c93303 697 'archetypes' => array(
20dd4cf5 698 'editingteacher' => CAP_ALLOW,
4f0c2d00 699 'manager' => CAP_ALLOW
20dd4cf5 700 )
701 ),
702
8ed5dd63 703 // Create, update and delete course categories. (Deleting a course category
704 // does not let you delete the courses it contains, unless you also have
705 // moodle/course: delete.) Creating and deleting requires this permission in
706 // the parent category.
707 'moodle/category:manage' => array(
eef868d1 708
89a792ab 709 'riskbitmask' => RISK_XSS,
710
bbbf2d40 711 'captype' => 'write',
712 'contextlevel' => CONTEXT_COURSECAT,
31c93303 713 'archetypes' => array(
4f0c2d00 714 'manager' => CAP_ALLOW
8ed5dd63 715 ),
716 'clonepermissionsfrom' => 'moodle/category:update'
bbbf2d40 717 ),
eef868d1 718
d26749b7 719 'moodle/category:viewcourselist' => array(
beff3806
MG
720
721 'captype' => 'read',
d26749b7 722 'contextlevel' => CONTEXT_COURSECAT,
beff3806
MG
723 'archetypes' => array(
724 'guest' => CAP_ALLOW,
725 'user' => CAP_ALLOW,
726 )
727 ),
728
8ed5dd63 729 'moodle/category:viewhiddencategories' => array(
eef868d1 730
8ed5dd63 731 'captype' => 'read',
bbbf2d40 732 'contextlevel' => CONTEXT_COURSECAT,
31c93303 733 'archetypes' => array(
8ed5dd63 734 'coursecreator' => CAP_ALLOW,
4f0c2d00 735 'manager' => CAP_ALLOW
8ed5dd63 736 ),
737 'clonepermissionsfrom' => 'moodle/category:visibility'
bbbf2d40 738 ),
eef868d1 739
3f791403
PS
740 // create, delete, move cohorts in system and course categories,
741 // (cohorts with component !== null can be only moved)
742 'moodle/cohort:manage' => array(
743
744 'captype' => 'write',
745 'contextlevel' => CONTEXT_COURSECAT,
31c93303 746 'archetypes' => array(
3f791403
PS
747 'manager' => CAP_ALLOW
748 )
749 ),
750
751 // add and remove cohort members (only for cohorts where component !== null)
752 'moodle/cohort:assign' => array(
753
754 'captype' => 'write',
755 'contextlevel' => CONTEXT_COURSECAT,
31c93303 756 'archetypes' => array(
3f791403
PS
757 'manager' => CAP_ALLOW
758 )
759 ),
760
80f98467 761 // View visible and hidden cohorts defined in the current context.
3f791403
PS
762 'moodle/cohort:view' => array(
763
764 'captype' => 'read',
765 'contextlevel' => CONTEXT_COURSE,
31c93303 766 'archetypes' => array(
3f791403
PS
767 'editingteacher' => CAP_ALLOW,
768 'manager' => CAP_ALLOW
769 )
770 ),
771
bbbf2d40 772 'moodle/course:create' => array(
eef868d1 773
21b6db6e 774 'riskbitmask' => RISK_XSS,
775
bbbf2d40 776 'captype' => 'write',
5e992f56 777 'contextlevel' => CONTEXT_COURSECAT,
31c93303 778 'archetypes' => array(
4473252d 779 'coursecreator' => CAP_ALLOW,
4f0c2d00 780 'manager' => CAP_ALLOW
bbbf2d40 781 )
782 ),
eef868d1 783
59f98779
MN
784 'moodle/course:creategroupconversations' => array(
785 'riskbitmask' => RISK_XSS,
786 'captype' => 'write',
787 'contextlevel' => CONTEXT_COURSE,
788 'archetypes' => array(
789 'editingteacher' => CAP_ALLOW,
790 'manager' => CAP_ALLOW
791 )
792 ),
793
e452210a 794 'moodle/course:request' => array(
795 'captype' => 'write',
3e15abe5 796 'contextlevel' => CONTEXT_COURSECAT,
e452210a 797 ),
798
bbbf2d40 799 'moodle/course:delete' => array(
eef868d1 800
3a0c6cca 801 'riskbitmask' => RISK_DATALOSS,
802
bbbf2d40 803 'captype' => 'write',
804 'contextlevel' => CONTEXT_COURSE,
31c93303 805 'archetypes' => array(
4f0c2d00 806 'manager' => CAP_ALLOW
bbbf2d40 807 )
808 ),
eef868d1 809
bbbf2d40 810 'moodle/course:update' => array(
eef868d1 811
21b6db6e 812 'riskbitmask' => RISK_XSS,
813
bbbf2d40 814 'captype' => 'write',
815 'contextlevel' => CONTEXT_COURSE,
31c93303 816 'archetypes' => array(
bbbf2d40 817 'editingteacher' => CAP_ALLOW,
4f0c2d00 818 'manager' => CAP_ALLOW
bbbf2d40 819 )
820 ),
eef868d1 821
df997f84 822 'moodle/course:view' => array(
eef868d1 823
bbbf2d40 824 'captype' => 'read',
825 'contextlevel' => CONTEXT_COURSE,
31c93303 826 'archetypes' => array(
df997f84 827 'manager' => CAP_ALLOW,
bbbf2d40 828 )
829 ),
eef868d1 830
df997f84
PS
831 /* review course enrolments - no group restrictions, it is really full access to all participants info*/
832 'moodle/course:enrolreview' => array(
833
834 'riskbitmask' => RISK_PERSONAL,
4f0c2d00
PS
835
836 'captype' => 'read',
837 'contextlevel' => CONTEXT_COURSE,
31c93303 838 'archetypes' => array(
df997f84
PS
839 'editingteacher' => CAP_ALLOW,
840 'manager' => CAP_ALLOW,
841 )
842 ),
843
844 /* add, remove, hide enrol instances in courses */
845 'moodle/course:enrolconfig' => array(
846
847 'riskbitmask' => RISK_PERSONAL,
848
849 'captype' => 'write',
850 'contextlevel' => CONTEXT_COURSE,
851 'archetypes' => array(
852 'editingteacher' => CAP_ALLOW,
4f0c2d00
PS
853 'manager' => CAP_ALLOW,
854 )
855 ),
856
288e7b09
EM
857 'moodle/course:reviewotherusers' => array(
858
859 'captype' => 'read',
860 'contextlevel' => CONTEXT_COURSE,
861 'archetypes' => array(
862 'editingteacher' => CAP_ALLOW,
863 'manager' => CAP_ALLOW,
864 ),
865 'clonepermissionsfrom' => 'moodle/role:assign'
866 ),
867
77c645df 868 'moodle/course:bulkmessaging' => array(
869
870 'riskbitmask' => RISK_SPAM,
871
872 'captype' => 'write',
873 'contextlevel' => CONTEXT_COURSE,
31c93303 874 'archetypes' => array(
77c645df 875 'teacher' => CAP_ALLOW,
876 'editingteacher' => CAP_ALLOW,
4f0c2d00 877 'manager' => CAP_ALLOW
77c645df 878 )
879 ),
880
1c45e42e 881 'moodle/course:viewhiddenuserfields' => array(
eef868d1 882
21b6db6e 883 'riskbitmask' => RISK_PERSONAL,
4e781c7b 884
885 'captype' => 'read',
886 'contextlevel' => CONTEXT_COURSE,
31c93303 887 'archetypes' => array(
4e781c7b 888 'teacher' => CAP_ALLOW,
889 'editingteacher' => CAP_ALLOW,
4f0c2d00 890 'manager' => CAP_ALLOW
4e781c7b 891 )
892 ),
893
1c45e42e 894 'moodle/course:viewhiddencourses' => array(
eef868d1 895
1c45e42e 896 'captype' => 'read',
897 'contextlevel' => CONTEXT_COURSE,
31c93303 898 'archetypes' => array(
2f5ab42b 899 'coursecreator' => CAP_ALLOW,
900 'teacher' => CAP_ALLOW,
901 'editingteacher' => CAP_ALLOW,
4f0c2d00 902 'manager' => CAP_ALLOW
1c45e42e 903 )
904 ),
eef868d1 905
bbbf2d40 906 'moodle/course:visibility' => array(
eef868d1 907
bbbf2d40 908 'captype' => 'write',
909 'contextlevel' => CONTEXT_COURSE,
31c93303 910 'archetypes' => array(
df997f84 911 'editingteacher' => CAP_ALLOW,
4f0c2d00 912 'manager' => CAP_ALLOW
bbbf2d40 913 )
914 ),
eef868d1 915
a028c291 916 'moodle/course:managefiles' => array(
eef868d1 917
21b6db6e 918 'riskbitmask' => RISK_XSS,
919
a028c291 920 'captype' => 'write',
921 'contextlevel' => CONTEXT_COURSE,
31c93303 922 'archetypes' => array(
a028c291 923 'editingteacher' => CAP_ALLOW,
4f0c2d00 924 'manager' => CAP_ALLOW
a028c291 925 )
926 ),
eef868d1 927
6a36b852
J
928 'moodle/course:ignoreavailabilityrestrictions' => array(
929 'captype' => 'read',
930 'contextlevel' => CONTEXT_MODULE,
931 'archetypes' => array(
932 'manager' => CAP_ALLOW,
933 'coursecreator' => CAP_ALLOW,
934 'editingteacher' => CAP_ALLOW,
935 'teacher' => CAP_ALLOW,
936 ),
937 'clonepermissionsfrom' => 'moodle/course:viewhiddenactivities'
938 ),
939
8ac95c27
AD
940 'moodle/course:ignorefilesizelimits' => array(
941
942 'captype' => 'write',
943 'contextlevel' => CONTEXT_COURSE,
944 'archetypes' => array(
945 )
946 ),
947
bbbf2d40 948 'moodle/course:manageactivities' => array(
eef868d1 949
21b6db6e 950 'riskbitmask' => RISK_XSS,
951
bbbf2d40 952 'captype' => 'write',
af189935 953 'contextlevel' => CONTEXT_MODULE,
31c93303 954 'archetypes' => array(
bbbf2d40 955 'editingteacher' => CAP_ALLOW,
4f0c2d00 956 'manager' => CAP_ALLOW
bbbf2d40 957 )
958 ),
eef868d1 959
bbbf2d40 960 'moodle/course:activityvisibility' => array(
eef868d1 961
bbbf2d40 962 'captype' => 'write',
af189935 963 'contextlevel' => CONTEXT_MODULE,
31c93303 964 'archetypes' => array(
bbbf2d40 965 'editingteacher' => CAP_ALLOW,
4f0c2d00 966 'manager' => CAP_ALLOW
bbbf2d40 967 )
968 ),
eef868d1 969
bbbf2d40 970 'moodle/course:viewhiddenactivities' => array(
eef868d1 971
bbbf2d40 972 'captype' => 'write',
af189935 973 'contextlevel' => CONTEXT_MODULE,
31c93303 974 'archetypes' => array(
bbbf2d40 975 'teacher' => CAP_ALLOW,
976 'editingteacher' => CAP_ALLOW,
4f0c2d00 977 'manager' => CAP_ALLOW
bbbf2d40 978 )
979 ),
eef868d1 980
bbbf2d40 981 'moodle/course:viewparticipants' => array(
eef868d1 982
bbbf2d40 983 'captype' => 'read',
984 'contextlevel' => CONTEXT_COURSE,
31c93303 985 'archetypes' => array(
bbbf2d40 986 'student' => CAP_ALLOW,
987 'teacher' => CAP_ALLOW,
988 'editingteacher' => CAP_ALLOW,
4f0c2d00 989 'manager' => CAP_ALLOW
165088f6 990 )
991 ),
f7c0d84b 992
993 'moodle/course:changefullname' => array(
994
cd7f72c0 995 'riskbitmask' => RISK_XSS,
996
f7c0d84b 997 'captype' => 'write',
998 'contextlevel' => CONTEXT_COURSE,
31c93303 999 'archetypes' => array(
f7c0d84b 1000 'editingteacher' => CAP_ALLOW,
4f0c2d00 1001 'manager' => CAP_ALLOW
5e99b9d7 1002 ),
1003 'clonepermissionsfrom' => 'moodle/course:update'
f7c0d84b 1004 ),
1005
1006 'moodle/course:changeshortname' => array(
1007
cd7f72c0 1008 'riskbitmask' => RISK_XSS,
1009
f7c0d84b 1010 'captype' => 'write',
1011 'contextlevel' => CONTEXT_COURSE,
31c93303 1012 'archetypes' => array(
f7c0d84b 1013 'editingteacher' => CAP_ALLOW,
4f0c2d00 1014 'manager' => CAP_ALLOW
5e99b9d7 1015 ),
1016 'clonepermissionsfrom' => 'moodle/course:update'
f7c0d84b 1017 ),
1018
7a0162f1
DM
1019 'moodle/course:changelockedcustomfields' => array(
1020
1021 'riskbitmask' => RISK_SPAM,
1022
1023 'captype' => 'write',
1024 'contextlevel' => CONTEXT_COURSE,
1025 'archetypes' => array(
1026 'manager' => CAP_ALLOW
1027 ),
1028 ),
1029
1030 'moodle/course:configurecustomfields' => array(
1031
1032 'riskbitmask' => RISK_SPAM,
1033
1034 'captype' => 'write',
1035 'contextlevel' => CONTEXT_SYSTEM,
1036 'clonepermissionsfrom' => 'moodle/site:config'
1037 ),
1038
502336f2
AH
1039 'moodle/course:renameroles' => array(
1040 'captype' => 'write',
1041 'contextlevel' => CONTEXT_COURSE,
1042 'archetypes' => array(
1043 'editingteacher' => CAP_ALLOW,
1044 'manager' => CAP_ALLOW
1045 ),
1046 'clonepermissionsfrom' => 'moodle/course:update'
1047 ),
1048
f7c0d84b 1049 'moodle/course:changeidnumber' => array(
1050
cd7f72c0 1051 'riskbitmask' => RISK_XSS,
1052
f7c0d84b 1053 'captype' => 'write',
1054 'contextlevel' => CONTEXT_COURSE,
31c93303 1055 'archetypes' => array(
f7c0d84b 1056 'editingteacher' => CAP_ALLOW,
4f0c2d00 1057 'manager' => CAP_ALLOW
5e99b9d7 1058 ),
1059 'clonepermissionsfrom' => 'moodle/course:update'
f7c0d84b 1060 ),
50569ba3 1061 'moodle/course:changecategory' => array(
1062 'riskbitmask' => RISK_XSS,
1063
1064 'captype' => 'write',
1065 'contextlevel' => CONTEXT_COURSE,
31c93303 1066 'archetypes' => array(
50569ba3 1067 'editingteacher' => CAP_ALLOW,
4f0c2d00 1068 'manager' => CAP_ALLOW
50569ba3 1069 ),
1070 'clonepermissionsfrom' => 'moodle/course:update'
1071 ),
1072
1073 'moodle/course:changesummary' => array(
1074 'riskbitmask' => RISK_XSS,
1075
1076 'captype' => 'write',
1077 'contextlevel' => CONTEXT_COURSE,
31c93303 1078 'archetypes' => array(
ecce4518
YS
1079 'editingteacher' => CAP_ALLOW,
1080 'manager' => CAP_ALLOW
1081 ),
1082 'clonepermissionsfrom' => 'moodle/course:update'
1083 ),
1084
1085 'moodle/course:setforcedlanguage' => array(
1086 'captype' => 'write',
1087 'contextlevel' => CONTEXT_COURSE,
1088 'archetypes' => array(
50569ba3 1089 'editingteacher' => CAP_ALLOW,
4f0c2d00 1090 'manager' => CAP_ALLOW
50569ba3 1091 ),
1092 'clonepermissionsfrom' => 'moodle/course:update'
1093 ),
1094
f7c0d84b 1095
165088f6 1096 'moodle/site:viewparticipants' => array(
1097
1098 'captype' => 'read',
1099 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1100 'archetypes' => array(
4f0c2d00 1101 'manager' => CAP_ALLOW
bbbf2d40 1102 )
1103 ),
eef868d1 1104
b61924d4 1105 'moodle/course:isincompletionreports' => array(
1106 'captype' => 'read',
1107 'contextlevel' => CONTEXT_COURSE,
1108 'archetypes' => array(
1109 'student' => CAP_ALLOW,
1110 ),
1111 ),
1112
bbbf2d40 1113 'moodle/course:viewscales' => array(
eef868d1 1114
bbbf2d40 1115 'captype' => 'read',
1116 'contextlevel' => CONTEXT_COURSE,
31c93303 1117 'archetypes' => array(
bbbf2d40 1118 'student' => CAP_ALLOW,
1119 'teacher' => CAP_ALLOW,
1120 'editingteacher' => CAP_ALLOW,
4f0c2d00 1121 'manager' => CAP_ALLOW
bbbf2d40 1122 )
1123 ),
eef868d1 1124
bbbf2d40 1125 'moodle/course:managescales' => array(
eef868d1 1126
bbbf2d40 1127 'captype' => 'write',
1128 'contextlevel' => CONTEXT_COURSE,
31c93303 1129 'archetypes' => array(
bbbf2d40 1130 'editingteacher' => CAP_ALLOW,
4f0c2d00 1131 'manager' => CAP_ALLOW
bbbf2d40 1132 )
1133 ),
eef868d1 1134
bbbf2d40 1135 'moodle/course:managegroups' => array(
6360f87c 1136 'riskbitmask' => RISK_XSS,
bbbf2d40 1137
1138 'captype' => 'write',
1139 'contextlevel' => CONTEXT_COURSE,
31c93303 1140 'archetypes' => array(
a028c291 1141 'editingteacher' => CAP_ALLOW,
4f0c2d00 1142 'manager' => CAP_ALLOW
a028c291 1143 )
1144 ),
eef868d1 1145
a028c291 1146 'moodle/course:reset' => array(
1147
3a0c6cca 1148 'riskbitmask' => RISK_DATALOSS,
1149
a028c291 1150 'captype' => 'write',
1151 'contextlevel' => CONTEXT_COURSE,
31c93303 1152 'archetypes' => array(
bbbf2d40 1153 'editingteacher' => CAP_ALLOW,
4f0c2d00 1154 'manager' => CAP_ALLOW
bbbf2d40 1155 )
1156 ),
eef868d1 1157
38c1dd19
RT
1158 'moodle/course:viewsuspendedusers' => array(
1159
1160 'captype' => 'read',
943e3f04 1161 'contextlevel' => CONTEXT_COURSE,
38c1dd19
RT
1162 'archetypes' => array(
1163 'editingteacher' => CAP_ALLOW,
1164 'manager' => CAP_ALLOW
1165 )
1166 ),
1167
0d1e5456
MG
1168 'moodle/course:tag' => array(
1169 'riskbitmask' => RISK_SPAM,
1170 'captype' => 'write',
1171 'contextlevel' => CONTEXT_COURSE,
1172 'archetypes' => array(
1173 'manager' => CAP_ALLOW,
1174 'editingteacher' => CAP_ALLOW,
1175 ),
1176 'clonepermissionsfrom' => 'moodle/course:update'
1177 ),
1178
bbbf2d40 1179 'moodle/blog:view' => array(
1180
1181 'captype' => 'read',
05de723b 1182 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1183 'archetypes' => array(
05de723b
NC
1184 'guest' => CAP_ALLOW,
1185 'user' => CAP_ALLOW,
1186 'student' => CAP_ALLOW,
1187 'teacher' => CAP_ALLOW,
1188 'editingteacher' => CAP_ALLOW,
4f0c2d00 1189 'manager' => CAP_ALLOW
05de723b
NC
1190 )
1191 ),
1192
1193 'moodle/blog:search' => array(
1194 'captype' => 'read',
1195 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1196 'archetypes' => array(
00adf177 1197 'guest' => CAP_ALLOW,
c785d40a 1198 'user' => CAP_ALLOW,
bbbf2d40 1199 'student' => CAP_ALLOW,
1200 'teacher' => CAP_ALLOW,
1201 'editingteacher' => CAP_ALLOW,
4f0c2d00 1202 'manager' => CAP_ALLOW
bbbf2d40 1203 )
1204 ),
eef868d1 1205
05de723b
NC
1206 'moodle/blog:viewdrafts' => array(
1207
1208 'riskbitmask' => RISK_PERSONAL,
1209 'captype' => 'read',
1210 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1211 'archetypes' => array(
4f0c2d00 1212 'manager' => CAP_ALLOW
05de723b
NC
1213 )
1214 ),
1215
5a8ab2e9 1216 'moodle/blog:create' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 1217
21b6db6e 1218 'riskbitmask' => RISK_SPAM,
1219
bbbf2d40 1220 'captype' => 'write',
1221 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1222 'archetypes' => array(
c785d40a 1223 'user' => CAP_ALLOW,
4f0c2d00 1224 'manager' => CAP_ALLOW
bbbf2d40 1225 )
1226 ),
eef868d1 1227
bbbf2d40 1228 'moodle/blog:manageentries' => array(
1229
21b6db6e 1230 'riskbitmask' => RISK_SPAM,
1231
bbbf2d40 1232 'captype' => 'write',
05de723b 1233 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1234 'archetypes' => array(
bbbf2d40 1235 'teacher' => CAP_ALLOW,
1236 'editingteacher' => CAP_ALLOW,
4f0c2d00 1237 'manager' => CAP_ALLOW
bbbf2d40 1238 )
1239 ),
05de723b 1240
cae83708 1241 'moodle/blog:manageexternal' => array(
1242
1243 'riskbitmask' => RISK_SPAM,
1244
1245 'captype' => 'write',
296f6c99 1246 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1247 'archetypes' => array(
cae83708 1248 'student' => CAP_ALLOW,
1249 'user' => CAP_ALLOW,
1250 'teacher' => CAP_ALLOW,
1251 'editingteacher' => CAP_ALLOW,
4f0c2d00 1252 'manager' => CAP_ALLOW
cae83708 1253 )
1254 ),
1255
5a8ab2e9 1256 'moodle/calendar:manageownentries' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 1257
21b6db6e 1258 'riskbitmask' => RISK_SPAM,
1259
bbbf2d40 1260 'captype' => 'write',
f432bebf 1261 'contextlevel' => CONTEXT_COURSE,
31c93303 1262 'archetypes' => array(
c785d40a 1263 'user' => CAP_ALLOW,
4f0c2d00 1264 'manager' => CAP_ALLOW
bbbf2d40 1265 )
1266 ),
eef868d1 1267
f63d2922 1268 'moodle/calendar:managegroupentries' => array(
1269
1270 'riskbitmask' => RISK_SPAM,
1271
1272 'captype' => 'write',
f432bebf 1273 'contextlevel' => CONTEXT_COURSE,
31c93303 1274 'archetypes' => array(
f63d2922 1275 'teacher' => CAP_ALLOW,
1276 'editingteacher' => CAP_ALLOW,
4f0c2d00 1277 'manager' => CAP_ALLOW
f63d2922 1278 )
1279 ),
1280
bbbf2d40 1281 'moodle/calendar:manageentries' => array(
1282
21b6db6e 1283 'riskbitmask' => RISK_SPAM,
1284
bbbf2d40 1285 'captype' => 'write',
f432bebf 1286 'contextlevel' => CONTEXT_COURSE,
31c93303 1287 'archetypes' => array(
bbbf2d40 1288 'teacher' => CAP_ALLOW,
1289 'editingteacher' => CAP_ALLOW,
4f0c2d00 1290 'manager' => CAP_ALLOW
bbbf2d40 1291 )
77d4953e 1292 ),
a044c05d 1293
1294 'moodle/user:editprofile' => array(
1295
3a0c6cca 1296 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
a044c05d 1297
1298 'captype' => 'write',
1299 'contextlevel' => CONTEXT_USER,
31c93303 1300 'archetypes' => array(
4f0c2d00 1301 'manager' => CAP_ALLOW
a044c05d 1302 )
1303 ),
eef868d1 1304
a5b8be62 1305 'moodle/user:editownprofile' => array(
1cb3da36 1306
3a0c6cca 1307 'riskbitmask' => RISK_SPAM,
1308
a5b8be62 1309 'captype' => 'write',
1310 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1311 'archetypes' => array(
1cb3da36 1312 'guest' => CAP_PROHIBIT,
1313 'user' => CAP_ALLOW,
4f0c2d00 1314 'manager' => CAP_ALLOW
a5b8be62 1315 )
1cb3da36 1316 ),
1317
a5b8be62 1318 'moodle/user:changeownpassword' => array(
1cb3da36 1319
a5b8be62 1320 'captype' => 'write',
1321 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1322 'archetypes' => array(
1cb3da36 1323 'guest' => CAP_PROHIBIT,
1324 'user' => CAP_ALLOW,
4f0c2d00 1325 'manager' => CAP_ALLOW
a5b8be62 1326 )
1cb3da36 1327 ),
1328
eef868d1 1329 // The next 3 might make no sense for some roles, e.g teacher, etc.
77d4953e 1330 // since the next level up is site. These are more for the parent role
1331 'moodle/user:readuserposts' => array(
bcdb0f19 1332
77d4953e 1333 'captype' => 'read',
4b10f08b 1334 'contextlevel' => CONTEXT_USER,
31c93303 1335 'archetypes' => array(
77d4953e 1336 'student' => CAP_ALLOW,
1337 'teacher' => CAP_ALLOW,
1338 'editingteacher' => CAP_ALLOW,
4f0c2d00 1339 'manager' => CAP_ALLOW
77d4953e 1340 )
1341 ),
eef868d1 1342
77d4953e 1343 'moodle/user:readuserblogs' => array(
bcdb0f19 1344
77d4953e 1345 'captype' => 'read',
4b10f08b 1346 'contextlevel' => CONTEXT_USER,
31c93303 1347 'archetypes' => array(
77d4953e 1348 'student' => CAP_ALLOW,
1349 'teacher' => CAP_ALLOW,
1350 'editingteacher' => CAP_ALLOW,
4f0c2d00 1351 'manager' => CAP_ALLOW
77d4953e 1352 )
1353 ),
eef868d1 1354
3c7da16d 1355 // designed for parent role - not used in legacy roles
77d4953e 1356 'moodle/user:viewuseractivitiesreport' => array(
3c7da16d 1357 'riskbitmask' => RISK_PERSONAL,
bcdb0f19 1358
77d4953e 1359 'captype' => 'read',
4b10f08b 1360 'contextlevel' => CONTEXT_USER,
31c93303 1361 'archetypes' => array(
77d4953e 1362 )
945f88ca 1363 ),
4e781c7b 1364
3b120e46 1365 //capabilities designed for the new message system configuration
1366 'moodle/user:editmessageprofile' => array(
f7c0d84b 1367
3b120e46 1368 'riskbitmask' => RISK_SPAM,
f7c0d84b 1369
3b120e46 1370 'captype' => 'write',
1371 'contextlevel' => CONTEXT_USER,
31c93303 1372 'archetypes' => array(
4f0c2d00 1373 'manager' => CAP_ALLOW
3b120e46 1374 )
1375 ),
f7c0d84b 1376
1377 'moodle/user:editownmessageprofile' => array(
1378
1379 'captype' => 'write',
1380 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1381 'archetypes' => array(
3b120e46 1382 'guest' => CAP_PROHIBIT,
1383 'user' => CAP_ALLOW,
4f0c2d00 1384 'manager' => CAP_ALLOW
f7c0d84b 1385 )
3b120e46 1386 ),
eef868d1 1387
271e6dec 1388 'moodle/question:managecategory' => array(
14d701d6 1389 'riskbitmask' => RISK_SPAM | RISK_XSS,
945f88ca 1390 'captype' => 'write',
1391 'contextlevel' => CONTEXT_COURSE,
31c93303 1392 'archetypes' => array(
945f88ca 1393 'editingteacher' => CAP_ALLOW,
4f0c2d00 1394 'manager' => CAP_ALLOW
945f88ca 1395 )
a5b8be62 1396 ),
1397
271e6dec 1398 //new in moodle 1.9
1399 'moodle/question:add' => array(
14d701d6 1400 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1401 'captype' => 'write',
1402 'contextlevel' => CONTEXT_COURSE,
31c93303 1403 'archetypes' => array(
271e6dec 1404 'editingteacher' => CAP_ALLOW,
4f0c2d00 1405 'manager' => CAP_ALLOW
271e6dec 1406 ),
1407 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1408 ),
271e6dec 1409 'moodle/question:editmine' => array(
14d701d6 1410 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1411 'captype' => 'write',
1412 'contextlevel' => CONTEXT_COURSE,
31c93303 1413 'archetypes' => array(
271e6dec 1414 'editingteacher' => CAP_ALLOW,
4f0c2d00 1415 'manager' => CAP_ALLOW
271e6dec 1416 ),
a5b8be62 1417 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1418 ),
1419 'moodle/question:editall' => array(
14d701d6 1420 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1421 'captype' => 'write',
1422 'contextlevel' => CONTEXT_COURSE,
31c93303 1423 'archetypes' => array(
271e6dec 1424 'editingteacher' => CAP_ALLOW,
4f0c2d00 1425 'manager' => CAP_ALLOW
271e6dec 1426 ),
a5b8be62 1427 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1428 ),
1429 'moodle/question:viewmine' => array(
945f88ca 1430 'captype' => 'read',
1431 'contextlevel' => CONTEXT_COURSE,
31c93303 1432 'archetypes' => array(
945f88ca 1433 'editingteacher' => CAP_ALLOW,
4f0c2d00 1434 'manager' => CAP_ALLOW
271e6dec 1435 ),
a5b8be62 1436 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1437 ),
271e6dec 1438 'moodle/question:viewall' => array(
1439 'captype' => 'read',
1440 'contextlevel' => CONTEXT_COURSE,
31c93303 1441 'archetypes' => array(
271e6dec 1442 'editingteacher' => CAP_ALLOW,
4f0c2d00 1443 'manager' => CAP_ALLOW
271e6dec 1444 ),
a5b8be62 1445 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1446 ),
1447 'moodle/question:usemine' => array(
1448 'captype' => 'read',
1449 'contextlevel' => CONTEXT_COURSE,
31c93303 1450 'archetypes' => array(
271e6dec 1451 'editingteacher' => CAP_ALLOW,
4f0c2d00 1452 'manager' => CAP_ALLOW
271e6dec 1453 ),
a5b8be62 1454 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1455 ),
1456 'moodle/question:useall' => array(
1457 'captype' => 'read',
1458 'contextlevel' => CONTEXT_COURSE,
31c93303 1459 'archetypes' => array(
271e6dec 1460 'editingteacher' => CAP_ALLOW,
4f0c2d00 1461 'manager' => CAP_ALLOW
271e6dec 1462 ),
a5b8be62 1463 'clonepermissionsfrom' => 'moodle/question:manage'
1464 ),
271e6dec 1465 'moodle/question:movemine' => array(
945f88ca 1466 'captype' => 'write',
1467 'contextlevel' => CONTEXT_COURSE,
31c93303 1468 'archetypes' => array(
945f88ca 1469 'editingteacher' => CAP_ALLOW,
4f0c2d00 1470 'manager' => CAP_ALLOW
271e6dec 1471 ),
a5b8be62 1472 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1473 ),
271e6dec 1474 'moodle/question:moveall' => array(
945f88ca 1475 'captype' => 'write',
1476 'contextlevel' => CONTEXT_COURSE,
31c93303 1477 'archetypes' => array(
945f88ca 1478 'editingteacher' => CAP_ALLOW,
4f0c2d00 1479 'manager' => CAP_ALLOW
271e6dec 1480 ),
a5b8be62 1481 'clonepermissionsfrom' => 'moodle/question:manage'
7191a1fa 1482 ),
271e6dec 1483 //END new in moodle 1.9
a5b8be62 1484
0eb6b04a 1485 // Configure the installed question types.
1486 'moodle/question:config' => array(
0eb6b04a 1487 'riskbitmask' => RISK_CONFIG,
0eb6b04a 1488 'captype' => 'write',
1489 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1490 'archetypes' => array(
4f0c2d00 1491 'manager' => CAP_ALLOW
0eb6b04a 1492 )
1493 ),
1494
62e76c67 1495 // While attempting questions, the ability to flag particular questions for later reference.
1496 'moodle/question:flag' => array(
1497 'captype' => 'write',
1498 'contextlevel' => CONTEXT_COURSE,
31c93303 1499 'archetypes' => array(
62e76c67 1500 'student' => CAP_ALLOW,
1501 'teacher' => CAP_ALLOW,
1502 'editingteacher' => CAP_ALLOW,
4f0c2d00 1503 'manager' => CAP_ALLOW
62e76c67 1504 )
1505 ),
bcdb0f19 1506
34cd7524
SL
1507 // Controls whether the user can tag his own questions.
1508 'moodle/question:tagmine' => array(
1509 'captype' => 'write',
1510 'contextlevel' => CONTEXT_COURSE,
1511 'archetypes' => array(
1512 'editingteacher' => CAP_ALLOW,
1513 'manager' => CAP_ALLOW
1514 ),
1515 'clonepermissionsfrom' => 'moodle/question:editmine'
1516 ),
1517
1518 // Controls whether the user can tag all questions.
1519 'moodle/question:tagall' => array(
1520 'captype' => 'write',
1521 'contextlevel' => CONTEXT_COURSE,
1522 'archetypes' => array(
1523 'editingteacher' => CAP_ALLOW,
1524 'manager' => CAP_ALLOW
1525 ),
1526 'clonepermissionsfrom' => 'moodle/question:editall'
1527 ),
1528
62e76c67 1529 'moodle/site:doclinks' => array(
7191a1fa 1530 'captype' => 'read',
1531 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1532 'archetypes' => array(
7191a1fa 1533 'teacher' => CAP_ALLOW,
1534 'editingteacher' => CAP_ALLOW,
4f0c2d00 1535 'manager' => CAP_ALLOW
7191a1fa 1536 )
3924b988 1537 ),
eef868d1 1538
3924b988 1539 'moodle/course:sectionvisibility' => array(
bcdb0f19 1540
3924b988 1541 'captype' => 'write',
1542 'contextlevel' => CONTEXT_COURSE,
31c93303 1543 'archetypes' => array(
3924b988 1544 'editingteacher' => CAP_ALLOW,
4f0c2d00 1545 'manager' => CAP_ALLOW
3924b988 1546 )
1547 ),
eef868d1 1548
dc558690 1549 'moodle/course:useremail' => array(
bcdb0f19 1550
dc558690 1551 'captype' => 'write',
1552 'contextlevel' => CONTEXT_COURSE,
31c93303 1553 'archetypes' => array(
dc558690 1554 'editingteacher' => CAP_ALLOW,
4f0c2d00 1555 'manager' => CAP_ALLOW
dc558690 1556 )
1557 ),
eef868d1 1558
3924b988 1559 'moodle/course:viewhiddensections' => array(
bcdb0f19 1560
3924b988 1561 'captype' => 'write',
1562 'contextlevel' => CONTEXT_COURSE,
31c93303 1563 'archetypes' => array(
3924b988 1564 'editingteacher' => CAP_ALLOW,
4f0c2d00 1565 'manager' => CAP_ALLOW
3924b988 1566 )
1567 ),
eef868d1 1568
3924b988 1569 'moodle/course:setcurrentsection' => array(
bcdb0f19 1570
3924b988 1571 'captype' => 'write',
1572 'contextlevel' => CONTEXT_COURSE,
31c93303 1573 'archetypes' => array(
3924b988 1574 'editingteacher' => CAP_ALLOW,
4f0c2d00 1575 'manager' => CAP_ALLOW
3924b988 1576 )
1577 ),
eef868d1 1578
ad778c84
FM
1579 'moodle/course:movesections' => array(
1580
1581 'captype' => 'write',
1582 'contextlevel' => CONTEXT_COURSE,
1583 'archetypes' => array(
1584 'editingteacher' => CAP_ALLOW,
1585 'manager' => CAP_ALLOW
1586 ),
1587 'clonepermissionsfrom' => 'moodle/course:update'
1588 ),
1589
dd45888a 1590 'moodle/site:mnetlogintoremote' => array(
bc4c9800 1591
3924b988 1592 'captype' => 'read',
dd45888a 1593 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1594 'archetypes' => array(
3924b988 1595 )
1596 ),
eef868d1 1597
dd45888a 1598 'moodle/grade:viewall' => array(
bcdb0f19 1599 'riskbitmask' => RISK_PERSONAL,
dd45888a 1600 'captype' => 'read',
eecf76df 1601 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_USER
31c93303 1602 'archetypes' => array(
dd45888a 1603 'teacher' => CAP_ALLOW,
3924b988 1604 'editingteacher' => CAP_ALLOW,
4f0c2d00 1605 'manager' => CAP_ALLOW
dd45888a 1606 ),
1607 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
f509ce06 1608 ),
f43ce1ad 1609
dd45888a 1610 'moodle/grade:view' => array(
f509ce06 1611 'captype' => 'read',
eecf76df 1612 'contextlevel' => CONTEXT_COURSE,
31c93303 1613 'archetypes' => array(
dd45888a 1614 'student' => CAP_ALLOW
f509ce06 1615 )
ca9ffa18 1616 ),
dd45888a 1617
1618 'moodle/grade:viewhidden' => array(
ca9ffa18 1619 'riskbitmask' => RISK_PERSONAL,
1620 'captype' => 'read',
eecf76df 1621 'contextlevel' => CONTEXT_COURSE,
31c93303 1622 'archetypes' => array(
0371f8e5 1623 'teacher' => CAP_ALLOW,
1624 'editingteacher' => CAP_ALLOW,
4f0c2d00 1625 'manager' => CAP_ALLOW
dd45888a 1626 ),
1627 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
ca9ffa18 1628 ),
dd45888a 1629
1630 'moodle/grade:import' => array(
3a0c6cca 1631 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
dd45888a 1632 'captype' => 'write',
ca9ffa18 1633 'contextlevel' => CONTEXT_COURSE,
31c93303 1634 'archetypes' => array(
ca9ffa18 1635 'editingteacher' => CAP_ALLOW,
4f0c2d00 1636 'manager' => CAP_ALLOW
dd45888a 1637 ),
1638 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1639 ),
dd45888a 1640
1641 'moodle/grade:export' => array(
ca9ffa18 1642 'riskbitmask' => RISK_PERSONAL,
1643 'captype' => 'read',
1644 'contextlevel' => CONTEXT_COURSE,
31c93303 1645 'archetypes' => array(
ca9ffa18 1646 'teacher' => CAP_ALLOW,
1647 'editingteacher' => CAP_ALLOW,
4f0c2d00 1648 'manager' => CAP_ALLOW
dd45888a 1649 ),
1650 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1651 ),
dd45888a 1652
1653 'moodle/grade:manage' => array(
3a0c6cca 1654 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
dd45888a 1655 'captype' => 'write',
1656 'contextlevel' => CONTEXT_COURSE,
31c93303 1657 'archetypes' => array(
dd45888a 1658 'editingteacher' => CAP_ALLOW,
4f0c2d00 1659 'manager' => CAP_ALLOW
dd45888a 1660 ),
1661 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1662 ),
dd45888a 1663
a5b8be62 1664 'moodle/grade:edit' => array(
1665 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
04259694 1666 'captype' => 'write',
1667 'contextlevel' => CONTEXT_COURSE,
31c93303 1668 'archetypes' => array(
04259694 1669 'editingteacher' => CAP_ALLOW,
4f0c2d00 1670 'manager' => CAP_ALLOW
04259694 1671 ),
1672 'clonepermissionsfrom' => 'moodle/course:managegrades'
1673 ),
1674
86e9ccfd
DM
1675 // ability to define advanced grading forms in activities either from scratch
1676 // or from a shared template
f25a5a32
DM
1677 'moodle/grade:managegradingforms' => array(
1678 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
1679 'captype' => 'write',
553af5fd 1680 'contextlevel' => CONTEXT_COURSE,
f25a5a32
DM
1681 'archetypes' => array(
1682 'editingteacher' => CAP_ALLOW,
1683 'manager' => CAP_ALLOW
1684 ),
1685 'clonepermissionsfrom' => 'moodle/course:managegrades'
04259694 1686 ),
1687
86e9ccfd
DM
1688 // ability to save a grading form as a new shared template and eventually edit
1689 // and remove own templates (templates originally shared by that user)
553af5fd 1690 'moodle/grade:sharegradingforms' => array(
86e9ccfd
DM
1691 'riskbitmask' => RISK_XSS,
1692 'captype' => 'write',
1693 'contextlevel' => CONTEXT_SYSTEM,
1694 'archetypes' => array(
1695 'manager' => CAP_ALLOW
1696 ),
1697 ),
1698
1699 // ability to edit and remove any shared template, even those originally shared
1700 // by other users
1701 'moodle/grade:managesharedforms' => array(
1702 'riskbitmask' => RISK_XSS,
553af5fd
DM
1703 'captype' => 'write',
1704 'contextlevel' => CONTEXT_SYSTEM,
1705 'archetypes' => array(
1706 'manager' => CAP_ALLOW
1707 ),
1708 ),
1709
a5b8be62 1710 'moodle/grade:manageoutcomes' => array(
284abb09 1711 'captype' => 'write',
1712 'contextlevel' => CONTEXT_COURSE,
31c93303 1713 'archetypes' => array(
284abb09 1714 'editingteacher' => CAP_ALLOW,
4f0c2d00 1715 'manager' => CAP_ALLOW
284abb09 1716 ),
1717 'clonepermissionsfrom' => 'moodle/course:managegrades'
1718 ),
1719
1720 'moodle/grade:manageletters' => array(
ca9ffa18 1721 'captype' => 'write',
1722 'contextlevel' => CONTEXT_COURSE,
31c93303 1723 'archetypes' => array(
ca9ffa18 1724 'editingteacher' => CAP_ALLOW,
4f0c2d00 1725 'manager' => CAP_ALLOW
a5b8be62 1726 ),
1727 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1728 ),
dd45888a 1729
a5b8be62 1730 'moodle/grade:hide' => array(
ca9ffa18 1731 'captype' => 'write',
1732 'contextlevel' => CONTEXT_COURSE,
31c93303 1733 'archetypes' => array(
ca9ffa18 1734 'editingteacher' => CAP_ALLOW,
4f0c2d00 1735 'manager' => CAP_ALLOW
ca9ffa18 1736 )
1737 ),
dd45888a 1738
a5b8be62 1739 'moodle/grade:lock' => array(
dd45888a 1740 'captype' => 'write',
ca9ffa18 1741 'contextlevel' => CONTEXT_COURSE,
31c93303 1742 'archetypes' => array(
ca9ffa18 1743 'editingteacher' => CAP_ALLOW,
4f0c2d00 1744 'manager' => CAP_ALLOW
ca9ffa18 1745 )
1746 ),
dd45888a 1747
a5b8be62 1748 'moodle/grade:unlock' => array(
ca9ffa18 1749 'captype' => 'write',
1750 'contextlevel' => CONTEXT_COURSE,
31c93303 1751 'archetypes' => array(
ca9ffa18 1752 'editingteacher' => CAP_ALLOW,
4f0c2d00 1753 'manager' => CAP_ALLOW
ca9ffa18 1754 )
282c1695 1755 ),
dd45888a 1756
1757 'moodle/my:manageblocks' => array(
282c1695 1758 'captype' => 'write',
1759 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1760 'archetypes' => array(
282c1695 1761 'user' => CAP_ALLOW
1762 )
eca3af25 1763 ),
dd45888a 1764
eca3af25 1765 'moodle/notes:view' => array(
1766 'captype' => 'read',
f432bebf 1767 'contextlevel' => CONTEXT_COURSE,
31c93303 1768 'archetypes' => array(
eca3af25 1769 'teacher' => CAP_ALLOW,
1770 'editingteacher' => CAP_ALLOW,
4f0c2d00 1771 'manager' => CAP_ALLOW
eca3af25 1772 )
1773 ),
1774
1775 'moodle/notes:manage' => array(
3a0c6cca 1776 'riskbitmask' => RISK_SPAM,
1777
eca3af25 1778 'captype' => 'write',
f432bebf 1779 'contextlevel' => CONTEXT_COURSE,
31c93303 1780 'archetypes' => array(
eca3af25 1781 'teacher' => CAP_ALLOW,
1782 'editingteacher' => CAP_ALLOW,
4f0c2d00 1783 'manager' => CAP_ALLOW
eca3af25 1784 )
dd45888a 1785 ),
79642064 1786
1787 'moodle/tag:manage' => array(
3a0c6cca 1788 'riskbitmask' => RISK_SPAM,
1789
79642064 1790 'captype' => 'write',
1791 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1792 'archetypes' => array(
4f0c2d00 1793 'manager' => CAP_ALLOW
79642064 1794 )
705789bd 1795 ),
1796
705789bd 1797 'moodle/tag:edit' => array(
3a0c6cca 1798 'riskbitmask' => RISK_SPAM,
1799
705789bd 1800 'captype' => 'write',
1801 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1802 'archetypes' => array(
dd8a0a39 1803 'manager' => CAP_ALLOW
98b5789d 1804 )
1805 ),
a5b8be62 1806
7dd764b8
JG
1807 'moodle/tag:flag' => array(
1808 'riskbitmask' => RISK_SPAM,
1809
1810 'captype' => 'write',
1811 'contextlevel' => CONTEXT_SYSTEM,
1812 'archetypes' => array(
7dd764b8
JG
1813 'user' => CAP_ALLOW
1814 )
1815 ),
1816
98b5789d 1817 'moodle/tag:editblocks' => array(
1818 'captype' => 'write',
1819 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1820 'archetypes' => array(
705789bd 1821 'teacher' => CAP_ALLOW,
1822 'editingteacher' => CAP_ALLOW,
4f0c2d00 1823 'manager' => CAP_ALLOW
705789bd 1824 )
7e874772 1825 ),
1826
1827 'moodle/block:view' => array(
1828 'captype' => 'read',
1829 'contextlevel' => CONTEXT_BLOCK,
31c93303 1830 'archetypes' => array(
7e874772 1831 'guest' => CAP_ALLOW,
25a7d980 1832 'user' => CAP_ALLOW,
1833 'student' => CAP_ALLOW,
1834 'teacher' => CAP_ALLOW,
1835 'editingteacher' => CAP_ALLOW,
7e874772 1836 )
8512f577 1837 ),
1838
d14edf06 1839 'moodle/block:edit' => array(
1840 'riskbitmask' => RISK_SPAM | RISK_XSS,
1841
1842 'captype' => 'write',
1843 'contextlevel' => CONTEXT_BLOCK,
31c93303 1844 'archetypes' => array(
d14edf06 1845 'editingteacher' => CAP_ALLOW,
586e7976 1846 'manager' => CAP_ALLOW
d14edf06 1847 )
1848 ),
1849
8512f577 1850 'moodle/portfolio:export' => array(
1851 'captype' => 'read',
1852 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1853 'archetypes' => array(
8512f577 1854 'user' => CAP_ALLOW,
1855 'student' => CAP_ALLOW,
1856 'teacher' => CAP_ALLOW,
1857 'editingteacher' => CAP_ALLOW,
8512f577 1858 )
1bcb7eb5 1859 ),
1860 'moodle/comment:view' => array(
1bcb7eb5 1861 'captype' => 'read',
ad0ae261 1862 'contextlevel' => CONTEXT_COURSE,
31c93303 1863 'archetypes' => array(
b3da2877
SH
1864 'frontpage' => CAP_ALLOW,
1865 'guest' => CAP_ALLOW,
1bcb7eb5 1866 'user' => CAP_ALLOW,
1867 'student' => CAP_ALLOW,
1868 'teacher' => CAP_ALLOW,
1869 'editingteacher' => CAP_ALLOW,
4f0c2d00 1870 'manager' => CAP_ALLOW
1bcb7eb5 1871 )
1872 ),
1873 'moodle/comment:post' => array(
1874
1875 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
1876 'captype' => 'write',
ad0ae261 1877 'contextlevel' => CONTEXT_COURSE,
31c93303 1878 'archetypes' => array(
1bcb7eb5 1879 'user' => CAP_ALLOW,
1880 'student' => CAP_ALLOW,
1881 'teacher' => CAP_ALLOW,
1882 'editingteacher' => CAP_ALLOW,
4f0c2d00 1883 'manager' => CAP_ALLOW
1bcb7eb5 1884 )
1885 ),
1886 'moodle/comment:delete' => array(
1887
1888 'riskbitmask' => RISK_DATALOSS,
1889 'captype' => 'write',
ad0ae261 1890 'contextlevel' => CONTEXT_COURSE,
31c93303 1891 'archetypes' => array(
1bcb7eb5 1892 'editingteacher' => CAP_ALLOW,
4f0c2d00 1893 'manager' => CAP_ALLOW
1bcb7eb5 1894 )
5eacbd4b 1895 ),
1896 'moodle/webservice:createtoken' => array(
1897
52dd27bf 1898 'riskbitmask' => RISK_CONFIG | RISK_DATALOSS | RISK_SPAM | RISK_PERSONAL | RISK_XSS,
5eacbd4b 1899 'captype' => 'write',
1900 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1901 'archetypes' => array(
4f0c2d00 1902 'manager' => CAP_ALLOW
5eacbd4b 1903 )
a09aeee4 1904 ),
ad2ae6e3
JO
1905 'moodle/webservice:managealltokens' => array(
1906
1907 'riskbitmask' => RISK_CONFIG | RISK_DATALOSS | RISK_PERSONAL,
1908 'captype' => 'write',
1909 'contextlevel' => CONTEXT_SYSTEM,
1910 'archetypes' => array()
1911 ),
13ea96c4
DC
1912 'moodle/webservice:createmobiletoken' => array(
1913
f2eac756 1914 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
13ea96c4
DC
1915 'captype' => 'write',
1916 'contextlevel' => CONTEXT_SYSTEM,
1917 'archetypes' => array(
1918 'user' => CAP_ALLOW
1919 )
1920 ),
19fae119 1921 'moodle/rating:view' => array(
ad0ae261 1922
a09aeee4 1923 'captype' => 'read',
ad0ae261 1924 'contextlevel' => CONTEXT_COURSE,
31c93303 1925 'archetypes' => array(
ad0ae261 1926 'user' => CAP_ALLOW,
e116a818
AD
1927 'student' => CAP_ALLOW,
1928 'teacher' => CAP_ALLOW,
1929 'editingteacher' => CAP_ALLOW,
4f0c2d00 1930 'manager' => CAP_ALLOW
a09aeee4
AD
1931 )
1932 ),
6595a568 1933 'moodle/rating:viewany' => array(
ad0ae261 1934
6595a568
MD
1935 'riskbitmask' => RISK_PERSONAL,
1936 'captype' => 'read',
ad0ae261 1937 'contextlevel' => CONTEXT_COURSE,
31c93303 1938 'archetypes' => array(
ad0ae261 1939 'user' => CAP_ALLOW,
6595a568
MD
1940 'student' => CAP_ALLOW,
1941 'teacher' => CAP_ALLOW,
1942 'editingteacher' => CAP_ALLOW,
1943 'manager' => CAP_ALLOW
1944 )
1945 ),
19fae119 1946 'moodle/rating:viewall' => array(
ad0ae261 1947
a09aeee4
AD
1948 'riskbitmask' => RISK_PERSONAL,
1949 'captype' => 'read',
ad0ae261 1950 'contextlevel' => CONTEXT_COURSE,
31c93303 1951 'archetypes' => array(
ad0ae261 1952 'user' => CAP_ALLOW,
6595a568 1953 'student' => CAP_ALLOW,
e116a818
AD
1954 'teacher' => CAP_ALLOW,
1955 'editingteacher' => CAP_ALLOW,
4f0c2d00 1956 'manager' => CAP_ALLOW
a09aeee4
AD
1957 )
1958 ),
19fae119 1959 'moodle/rating:rate' => array(
ad0ae261 1960
a09aeee4 1961 'captype' => 'write',
ad0ae261 1962 'contextlevel' => CONTEXT_COURSE,
31c93303 1963 'archetypes' => array(
ad0ae261 1964 'user' => CAP_ALLOW,
6595a568 1965 'student' => CAP_ALLOW,
e116a818
AD
1966 'teacher' => CAP_ALLOW,
1967 'editingteacher' => CAP_ALLOW,
4f0c2d00 1968 'manager' => CAP_ALLOW
a09aeee4 1969 )
2be4d090
MD
1970 ),
1971 'moodle/course:markcomplete' => array(
1972 'captype' => 'write',
1973 'contextlevel' => CONTEXT_COURSE,
31c93303 1974 'archetypes' => array(
2be4d090
MD
1975 'teacher' => CAP_ALLOW,
1976 'editingteacher' => CAP_ALLOW,
2be4d090
MD
1977 'manager' => CAP_ALLOW
1978 )
755f96f8 1979 ),
a39918da
EEAK
1980 'moodle/course:overridecompletion' => array(
1981 'captype' => 'write',
1982 'contextlevel' => CONTEXT_COURSE,
1983 'archetypes' => array(
1984 'teacher' => CAP_ALLOW,
1985 'editingteacher' => CAP_ALLOW,
1986 'manager' => CAP_ALLOW
1987 )
1988 ),
27806552
YB
1989
1990 // Badges.
1991 'moodle/badges:manageglobalsettings' => array(
1992 'riskbitmask' => RISK_DATALOSS | RISK_CONFIG,
1993 'captype' => 'write',
1994 'contextlevel' => CONTEXT_SYSTEM,
1995 'archetypes' => array(
1996 'manager' => CAP_ALLOW,
27806552
YB
1997 )
1998 ),
1999
2000 // View available badges without earning them.
2001 'moodle/badges:viewbadges' => array(
2002 'captype' => 'read',
3e9f4c7b 2003 'contextlevel' => CONTEXT_COURSE,
27806552 2004 'archetypes' => array(
27806552 2005 'user' => CAP_ALLOW,
27806552
YB
2006 )
2007 ),
2008
2009 // Manage badges on own private badges page.
2010 'moodle/badges:manageownbadges' => array(
3e9f4c7b 2011 'riskbitmap' => RISK_SPAM,
27806552 2012 'captype' => 'write',
3e9f4c7b 2013 'contextlevel' => CONTEXT_USER,
27806552
YB
2014 'archetypes' => array(
2015 'user' => CAP_ALLOW
2016 )
2017 ),
2018
2019 // View public badges in other users' profiles.
2020 'moodle/badges:viewotherbadges' => array(
2021 'riskbitmap' => RISK_PERSONAL,
2022 'captype' => 'read',
2023 'contextlevel' => CONTEXT_USER,
2024 'archetypes' => array(
2025 'user' => CAP_ALLOW
2026 )
2027 ),
2028
2029 // Earn badge.
2030 'moodle/badges:earnbadge' => array(
2031 'captype' => 'write',
3e9f4c7b 2032 'contextlevel' => CONTEXT_COURSE,
27806552
YB
2033 'archetypes' => array(
2034 'user' => CAP_ALLOW,
27806552
YB
2035 )
2036 ),
2037
2038 // Create/duplicate badges.
2039 'moodle/badges:createbadge' => array(
3e9f4c7b 2040 'riskbitmask' => RISK_SPAM,
27806552 2041 'captype' => 'write',
3e9f4c7b 2042 'contextlevel' => CONTEXT_COURSE,
27806552
YB
2043 'archetypes' => array(
2044 'manager' => CAP_ALLOW,
27806552 2045 'editingteacher' => CAP_ALLOW,
27806552
YB
2046 )
2047 ),
2048
2049 // Delete badges.
2050 'moodle/badges:deletebadge' => array(
3e9f4c7b 2051 'riskbitmask' => RISK_DATALOSS,
27806552 2052 'captype' => 'write',
3e9f4c7b 2053 'contextlevel' => CONTEXT_COURSE,
27806552
YB
2054 'archetypes' => array(
2055 'manager' => CAP_ALLOW,
27806552 2056 'editingteacher' => CAP_ALLOW,
27806552
YB
2057 )
2058 ),
2059
2060 // Set up/edit badge details.
2061 'moodle/badges:configuredetails' => array(
3e9f4c7b 2062 'riskbitmask' => RISK_SPAM,
27806552 2063 'captype' => 'write',
3e9f4c7b 2064 'contextlevel' => CONTEXT_COURSE,
27806552
YB
2065 'archetypes' => array(
2066 'manager' => CAP_ALLOW,
27806552 2067 'editingteacher' => CAP_ALLOW,
27806552
YB
2068 )
2069 ),
2070
2071 // Set up/edit criteria of earning a badge.
2072 'moodle/badges:configurecriteria' => array(
0b6ba27a 2073 'riskbitmask' => RISK_XSS,
27806552 2074 'captype' => 'write',
3e9f4c7b 2075 'contextlevel' => CONTEXT_COURSE,
27806552
YB
2076 'archetypes' => array(
2077 'manager' => CAP_ALLOW,
27806552 2078 'editingteacher' => CAP_ALLOW,
27806552
YB
2079 )
2080 ),
2081
2082 // Configure badge messages.
2083 'moodle/badges:configuremessages' => array(
3e9f4c7b 2084 'riskbitmask' => RISK_SPAM,
27806552 2085 'captype' => 'write',
3e9f4c7b 2086 'contextlevel' => CONTEXT_COURSE,
27806552
YB
2087 'archetypes' => array(
2088 'manager' => CAP_ALLOW,
27806552 2089 'editingteacher' => CAP_ALLOW,
27806552
YB
2090 )
2091 ),
2092
2093 // Award badge to a user.
2094 'moodle/badges:awardbadge' => array(
2095 'riskbitmask' => RISK_SPAM,
2096 'captype' => 'write',
3e9f4c7b 2097 'contextlevel' => CONTEXT_COURSE,
27806552
YB
2098 'archetypes' => array(
2099 'manager' => CAP_ALLOW,
27806552
YB
2100 'teacher' => CAP_ALLOW,
2101 'editingteacher' => CAP_ALLOW,
27806552 2102 )
b7374fac
MD
2103 ),
2104
2105 // Revoke badge from a user.
2106 'moodle/badges:revokebadge' => array(
2107 'riskbitmask' => RISK_SPAM,
2108 'captype' => 'write',
2109 'contextlevel' => CONTEXT_COURSE,
2110 'archetypes' => array(
2111 'manager' => CAP_ALLOW,
2112 'teacher' => CAP_ALLOW,
2113 'editingteacher' => CAP_ALLOW,
2114 )
27806552
YB
2115 ),
2116
2117 // View users who earned a specific badge without being able to award a badge.
2118 'moodle/badges:viewawarded' => array(
2119 'riskbitmask' => RISK_PERSONAL,
2120 'captype' => 'read',
3e9f4c7b 2121 'contextlevel' => CONTEXT_COURSE,
27806552
YB
2122 'archetypes' => array(
2123 'manager' => CAP_ALLOW,
2124 'teacher' => CAP_ALLOW,
2125 'editingteacher' => CAP_ALLOW,
2126 )
c484af5a
BK
2127 ),
2128
2129 'moodle/site:forcelanguage' => array(
2130 'captype' => 'read',
2131 'contextlevel' => CONTEXT_SYSTEM,
2132 'archetypes' => array(
2133 )
69d66020
DM
2134 ),
2135
2136 // Perform site-wide search queries through the search API.
2137 'moodle/search:query' => array(
2138 'captype' => 'read',
2139 'contextlevel' => CONTEXT_SYSTEM,
2140 'archetypes' => array(
2141 'guest' => CAP_ALLOW,
2142 'user' => CAP_ALLOW,
2143 'student' => CAP_ALLOW,
2144 'teacher' => CAP_ALLOW,
2145 'editingteacher' => CAP_ALLOW,
2146 'manager' => CAP_ALLOW
2147 )
b90e2205
FM
2148 ),
2149
2150 // Competencies.
2151 'moodle/competency:competencymanage' => array(
2152 'captype' => 'write',
2153 'contextlevel' => CONTEXT_COURSECAT,
2154 'archetypes' => array(
2155 'manager' => CAP_ALLOW
2156 )
2157 ),
2158 'moodle/competency:competencyview' => array(
2159 'captype' => 'read',
2160 'contextlevel' => CONTEXT_COURSECAT,
2161 'archetypes' => array(
2162 'user' => CAP_ALLOW
2163 ),
b90e2205
FM
2164 ),
2165 'moodle/competency:competencygrade' => array(
2166 'captype' => 'write',
2167 'contextlevel' => CONTEXT_COURSE, // And CONTEXT_USER.
2168 'archetypes' => array(
2169 'editingteacher' => CAP_ALLOW,
2170 'teacher' => CAP_ALLOW,
2171 'manager' => CAP_ALLOW
2172 ),
2173 ),
2174 // Course competencies.
2175 'moodle/competency:coursecompetencymanage' => array(
2176 'captype' => 'write',
2177 'contextlevel' => CONTEXT_COURSE,
2178 'archetypes' => array(
2179 'editingteacher' => CAP_ALLOW,
2180 'manager' => CAP_ALLOW
2181 ),
b90e2205
FM
2182 ),
2183 'moodle/competency:coursecompetencyconfigure' => array(
2184 'captype' => 'write',
2185 'contextlevel' => CONTEXT_MODULE,
2186 'archetypes' => array(
2187 'manager' => CAP_ALLOW
2188 ),
b90e2205
FM
2189 ),
2190 'moodle/competency:coursecompetencygradable' => array(
2191 'captype' => 'read',
2192 'contextlevel' => CONTEXT_COURSE,
2193 'archetypes' => array(
2194 'student' => CAP_ALLOW
2195 ),
2196 'clonepermissionsfrom' => 'moodle/course:isincompletionreports'
2197 ),
2198 'moodle/competency:coursecompetencyview' => array(
2199 'captype' => 'read',
2200 'contextlevel' => CONTEXT_COURSE,
2201 'archetypes' => array(
2202 'user' => CAP_ALLOW
2203 ),
b90e2205 2204 ),
1e99f31e
FM
2205 // Evidence.
2206 'moodle/competency:evidencedelete' => array(
2207 'captype' => 'write',
2208 'contextlevel' => CONTEXT_USER,
2209 'archetypes' => array(
2210 ),
2211 'clonepermissionsfrom' => 'moodle/site:config'
2212 ),
b90e2205
FM
2213 // User plans.
2214 'moodle/competency:planmanage' => array(
2215 'captype' => 'write',
2216 'contextlevel' => CONTEXT_USER,
2217 'archetypes' => array(
f1a9fcd9 2218 'manager' => CAP_ALLOW
b90e2205 2219 ),
b90e2205
FM
2220 ),
2221 'moodle/competency:planmanagedraft' => array(
2222 'captype' => 'write',
2223 'contextlevel' => CONTEXT_USER,
2224 'archetypes' => array(
f1a9fcd9 2225 'manager' => CAP_ALLOW
b90e2205 2226 ),
b90e2205
FM
2227 ),
2228 'moodle/competency:planmanageown' => array(
2229 'captype' => 'write',
2230 'contextlevel' => CONTEXT_USER,
2231 'archetypes' => array(
2232 ),
b90e2205
FM
2233 ),
2234 'moodle/competency:planmanageowndraft' => array(
2235 'captype' => 'write',
2236 'contextlevel' => CONTEXT_USER,
2237 'archetypes' => array(
2238 ),
b90e2205
FM
2239 ),
2240 'moodle/competency:planview' => array(
2241 'captype' => 'read',
2242 'contextlevel' => CONTEXT_USER,
2243 'archetypes' => array(
f1a9fcd9 2244 'manager' => CAP_ALLOW
b90e2205 2245 ),
b90e2205
FM
2246 ),
2247 'moodle/competency:planviewdraft' => array(
2248 'captype' => 'read',
2249 'contextlevel' => CONTEXT_USER,
2250 'archetypes' => array(
f1a9fcd9 2251 'manager' => CAP_ALLOW
b90e2205 2252 ),
b90e2205
FM
2253 ),
2254 'moodle/competency:planviewown' => array(
2255 'captype' => 'read',
2256 'contextlevel' => CONTEXT_USER,
2257 'archetypes' => array(
2258 'user' => CAP_ALLOW
2259 ),
b90e2205
FM
2260 ),
2261 'moodle/competency:planviewowndraft' => array(
2262 'captype' => 'read',
2263 'contextlevel' => CONTEXT_USER,
2264 'archetypes' => array(
2265 ),
b90e2205
FM
2266 ),
2267 'moodle/competency:planrequestreview' => array(
2268 'captype' => 'write',
2269 'contextlevel' => CONTEXT_USER,
2270 'archetypes' => array(
f1a9fcd9 2271 'manager' => CAP_ALLOW
b90e2205
FM
2272 )
2273 ),
2274 'moodle/competency:planrequestreviewown' => array(
2275 'captype' => 'write',
2276 'contextlevel' => CONTEXT_USER,
2277 'archetypes' => array(
2278 'user' => CAP_ALLOW
2279 )
2280 ),
2281 'moodle/competency:planreview' => array(
2282 'captype' => 'write',
2283 'contextlevel' => CONTEXT_USER,
2284 'archetypes' => array(
f1a9fcd9 2285 'manager' => CAP_ALLOW
b90e2205 2286 ),
b90e2205
FM
2287 ),
2288 'moodle/competency:plancomment' => array(
2289 'captype' => 'write',
2290 'contextlevel' => CONTEXT_USER,
2291 'archetypes' => array(
f1a9fcd9 2292 'manager' => CAP_ALLOW
b90e2205 2293 ),
b90e2205
FM
2294 ),
2295 'moodle/competency:plancommentown' => array(
2296 'captype' => 'write',
2297 'contextlevel' => CONTEXT_USER,
2298 'archetypes' => array(
2299 'user' => CAP_ALLOW
2300 ),
2301 ),
2302 // User competencies.
2303 'moodle/competency:usercompetencyview' => array(
2304 'captype' => 'read',
2305 'contextlevel' => CONTEXT_USER, // And CONTEXT_COURSE.
2306 'archetypes' => array(
f1a9fcd9 2307 'manager' => CAP_ALLOW,
b90e2205
FM
2308 'editingteacher' => CAP_ALLOW,
2309 'teacher' => CAP_ALLOW
2310 )
2311 ),
2312 'moodle/competency:usercompetencyrequestreview' => array(
2313 'captype' => 'write',
2314 'contextlevel' => CONTEXT_USER,
2315 'archetypes' => array(
f1a9fcd9 2316 'manager' => CAP_ALLOW
b90e2205
FM
2317 )
2318 ),
2319 'moodle/competency:usercompetencyrequestreviewown' => array(
2320 'captype' => 'write',
2321 'contextlevel' => CONTEXT_USER,
2322 'archetypes' => array(
2323 'user' => CAP_ALLOW
2324 )
2325 ),
2326 'moodle/competency:usercompetencyreview' => array(
2327 'captype' => 'write',
2328 'contextlevel' => CONTEXT_USER,
2329 'archetypes' => array(
f1a9fcd9 2330 'manager' => CAP_ALLOW
b90e2205 2331 ),
b90e2205
FM
2332 ),
2333 'moodle/competency:usercompetencycomment' => array(
2334 'captype' => 'write',
2335 'contextlevel' => CONTEXT_USER,
2336 'archetypes' => array(
f1a9fcd9 2337 'manager' => CAP_ALLOW
b90e2205 2338 ),
b90e2205
FM
2339 ),
2340 'moodle/competency:usercompetencycommentown' => array(
2341 'captype' => 'write',
2342 'contextlevel' => CONTEXT_USER,
2343 'archetypes' => array(
2344 'user' => CAP_ALLOW
2345 ),
2346 ),
2347 // Template.
2348 'moodle/competency:templatemanage' => array(
2349 'captype' => 'write',
2350 'contextlevel' => CONTEXT_COURSECAT,
2351 'archetypes' => array(
f1a9fcd9 2352 'manager' => CAP_ALLOW
b90e2205 2353 ),
40fcb365
DM
2354 ),
2355 'moodle/analytics:listinsights' => array(
2356 'riskbitmask' => RISK_PERSONAL,
2357 'captype' => 'read',
2358 'contextlevel' => CONTEXT_COURSE,
2359 'archetypes' => array(
2360 'teacher' => CAP_ALLOW,
2361 'editingteacher' => CAP_ALLOW,
2362 'manager' => CAP_ALLOW
2363 )
2364 ),
2365 'moodle/analytics:managemodels' => array(
2366 'riskbitmask' => RISK_CONFIG,
2367 'captype' => 'write',
2368 'contextlevel' => CONTEXT_SYSTEM,
2369 'archetypes' => array(
2370 'manager' => CAP_ALLOW
2371 ),
b90e2205
FM
2372 ),
2373 'moodle/competency:templateview' => array(
2374 'captype' => 'read',
2375 'contextlevel' => CONTEXT_COURSECAT,
2376 'archetypes' => array(
f1a9fcd9 2377 'manager' => CAP_ALLOW
b90e2205 2378 ),
b90e2205
FM
2379 ),
2380 // User evidence.
2381 'moodle/competency:userevidencemanage' => array(
2382 'captype' => 'write',
2383 'contextlevel' => CONTEXT_USER,
2384 'archetypes' => array(
f1a9fcd9 2385 'manager' => CAP_ALLOW
b90e2205 2386 ),
b90e2205
FM
2387 ),
2388 'moodle/competency:userevidencemanageown' => array(
2389 'captype' => 'write',
2390 'contextlevel' => CONTEXT_USER,
2391 'archetypes' => array(
2392 'user' => CAP_ALLOW
2393 ),
b90e2205
FM
2394 ),
2395 'moodle/competency:userevidenceview' => array(
2396 'captype' => 'read',
2397 'contextlevel' => CONTEXT_USER,
2398 'archetypes' => array(
f1a9fcd9 2399 'manager' => CAP_ALLOW
b90e2205 2400 ),
b90e2205 2401 ),
59c66f92
MD
2402 'moodle/site:maintenanceaccess' => array(
2403 'captype' => 'write',
2404 'contextlevel' => CONTEXT_SYSTEM,
2405 'archetypes' => array(
2406 )
2407 ),
7983fb83
SA
2408 // Allow message any user, regardlesss of the privacy preferences for messaging.
2409 'moodle/site:messageanyuser' => array(
2410 'riskbitmask' => RISK_SPAM,
2411 'captype' => 'write',
2412 'contextlevel' => CONTEXT_SYSTEM,
2413 'archetypes' => array(
2414 'teacher' => CAP_ALLOW,
2415 'editingteacher' => CAP_ALLOW,
2416 'manager' => CAP_ALLOW
2417 )
2418 ),
69d66020 2419
0616f045
AN
2420 // Context locking/unlocking.
2421 'moodle/site:managecontextlocks' => [
2422 'captype' => 'write',
6a89b6c8 2423 'contextlevel' => CONTEXT_MODULE,
0616f045
AN
2424 'archetypes' => [
2425 ],
2426 ],
7868aab1
CF
2427
2428 // Manual completion toggling.
2429 'moodle/course:togglecompletion' => [
2430 'captype' => 'write',
2431 'contextlevel' => CONTEXT_MODULE,
2432 'archetypes' => [
2433 'user' => CAP_ALLOW,
2434 ],
2435 ],
50935afb
DM
2436
2437 'moodle/analytics:listowninsights' => array(
2438 'captype' => 'read',
2439 'contextlevel' => CONTEXT_SYSTEM,
2440 'archetypes' => array(
2441 'user' => CAP_ALLOW
2442 )
2443 ),
360755cc
SA
2444
2445 // Set display option buttons to an H5P content.
2446 'moodle/h5p:setdisplayoptions' => array(
2447 'captype' => 'write',
2448 'contextlevel' => CONTEXT_MODULE,
2449 'archetypes' => array(
2450 'editingteacher' => CAP_ALLOW,
2451 )
2452 ),
8fda136d
SA
2453
2454 // Allow to deploy H5P content.
2455 'moodle/h5p:deploy' => array(
2456 'riskbitmask' => RISK_XSS,
2457 'captype' => 'write',
2458 'contextlevel' => CONTEXT_MODULE,
2459 'archetypes' => array(
2460 'manager' => CAP_ALLOW,
2461 'editingteacher' => CAP_ALLOW,
2462 )
2463 ),
c07f31ae
SA
2464
2465 // Allow to update H5P content-type libraries.
2466 'moodle/h5p:updatelibraries' => [
2467 'riskbitmask' => RISK_XSS,
2468 'captype' => 'write',
2469 'contextlevel' => CONTEXT_MODULE,
2470 'archetypes' => [
2471 'manager' => CAP_ALLOW,
2472 ]
2473 ],
bbbf2d40 2474);