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