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