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