Moodle release 3.0rc3
[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
985 'moodle/course:changeidnumber' => array(
986
cd7f72c0 987 'riskbitmask' => RISK_XSS,
988
f7c0d84b 989 'captype' => 'write',
990 'contextlevel' => CONTEXT_COURSE,
31c93303 991 'archetypes' => array(
f7c0d84b 992 'editingteacher' => CAP_ALLOW,
4f0c2d00 993 'manager' => CAP_ALLOW
5e99b9d7 994 ),
995 'clonepermissionsfrom' => 'moodle/course:update'
f7c0d84b 996 ),
50569ba3 997 'moodle/course:changecategory' => array(
998 'riskbitmask' => RISK_XSS,
999
1000 'captype' => 'write',
1001 'contextlevel' => CONTEXT_COURSE,
31c93303 1002 'archetypes' => array(
50569ba3 1003 'editingteacher' => CAP_ALLOW,
4f0c2d00 1004 'manager' => CAP_ALLOW
50569ba3 1005 ),
1006 'clonepermissionsfrom' => 'moodle/course:update'
1007 ),
1008
1009 'moodle/course:changesummary' => array(
1010 'riskbitmask' => RISK_XSS,
1011
1012 'captype' => 'write',
1013 'contextlevel' => CONTEXT_COURSE,
31c93303 1014 'archetypes' => array(
50569ba3 1015 'editingteacher' => CAP_ALLOW,
4f0c2d00 1016 'manager' => CAP_ALLOW
50569ba3 1017 ),
1018 'clonepermissionsfrom' => 'moodle/course:update'
1019 ),
1020
f7c0d84b 1021
165088f6 1022 'moodle/site:viewparticipants' => array(
1023
1024 'captype' => 'read',
1025 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1026 'archetypes' => array(
4f0c2d00 1027 'manager' => CAP_ALLOW
bbbf2d40 1028 )
1029 ),
eef868d1 1030
b61924d4 1031 'moodle/course:isincompletionreports' => array(
1032 'captype' => 'read',
1033 'contextlevel' => CONTEXT_COURSE,
1034 'archetypes' => array(
1035 'student' => CAP_ALLOW,
1036 ),
1037 ),
1038
bbbf2d40 1039 'moodle/course:viewscales' => array(
eef868d1 1040
bbbf2d40 1041 'captype' => 'read',
1042 'contextlevel' => CONTEXT_COURSE,
31c93303 1043 'archetypes' => array(
bbbf2d40 1044 'student' => CAP_ALLOW,
1045 'teacher' => CAP_ALLOW,
1046 'editingteacher' => CAP_ALLOW,
4f0c2d00 1047 'manager' => CAP_ALLOW
bbbf2d40 1048 )
1049 ),
eef868d1 1050
bbbf2d40 1051 'moodle/course:managescales' => array(
eef868d1 1052
bbbf2d40 1053 'captype' => 'write',
1054 'contextlevel' => CONTEXT_COURSE,
31c93303 1055 'archetypes' => array(
bbbf2d40 1056 'editingteacher' => CAP_ALLOW,
4f0c2d00 1057 'manager' => CAP_ALLOW
bbbf2d40 1058 )
1059 ),
eef868d1 1060
bbbf2d40 1061 'moodle/course:managegroups' => array(
1062
1063 'captype' => 'write',
1064 'contextlevel' => CONTEXT_COURSE,
31c93303 1065 'archetypes' => array(
a028c291 1066 'editingteacher' => CAP_ALLOW,
4f0c2d00 1067 'manager' => CAP_ALLOW
a028c291 1068 )
1069 ),
eef868d1 1070
a028c291 1071 'moodle/course:reset' => array(
1072
3a0c6cca 1073 'riskbitmask' => RISK_DATALOSS,
1074
a028c291 1075 'captype' => 'write',
1076 'contextlevel' => CONTEXT_COURSE,
31c93303 1077 'archetypes' => array(
bbbf2d40 1078 'editingteacher' => CAP_ALLOW,
4f0c2d00 1079 'manager' => CAP_ALLOW
bbbf2d40 1080 )
1081 ),
eef868d1 1082
38c1dd19
RT
1083 'moodle/course:viewsuspendedusers' => array(
1084
1085 'captype' => 'read',
1086 'contextlevel' => CONTEXT_SYSTEM,
1087 'archetypes' => array(
1088 'editingteacher' => CAP_ALLOW,
1089 'manager' => CAP_ALLOW
1090 )
1091 ),
1092
0d1e5456
MG
1093 'moodle/course:tag' => array(
1094 'riskbitmask' => RISK_SPAM,
1095 'captype' => 'write',
1096 'contextlevel' => CONTEXT_COURSE,
1097 'archetypes' => array(
1098 'manager' => CAP_ALLOW,
1099 'editingteacher' => CAP_ALLOW,
1100 ),
1101 'clonepermissionsfrom' => 'moodle/course:update'
1102 ),
1103
bbbf2d40 1104 'moodle/blog:view' => array(
1105
1106 'captype' => 'read',
05de723b 1107 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1108 'archetypes' => array(
05de723b
NC
1109 'guest' => CAP_ALLOW,
1110 'user' => CAP_ALLOW,
1111 'student' => CAP_ALLOW,
1112 'teacher' => CAP_ALLOW,
1113 'editingteacher' => CAP_ALLOW,
4f0c2d00 1114 'manager' => CAP_ALLOW
05de723b
NC
1115 )
1116 ),
1117
1118 'moodle/blog:search' => array(
1119 'captype' => 'read',
1120 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1121 'archetypes' => array(
00adf177 1122 'guest' => CAP_ALLOW,
c785d40a 1123 'user' => CAP_ALLOW,
bbbf2d40 1124 'student' => CAP_ALLOW,
1125 'teacher' => CAP_ALLOW,
1126 'editingteacher' => CAP_ALLOW,
4f0c2d00 1127 'manager' => CAP_ALLOW
bbbf2d40 1128 )
1129 ),
eef868d1 1130
05de723b
NC
1131 'moodle/blog:viewdrafts' => array(
1132
1133 'riskbitmask' => RISK_PERSONAL,
1134 'captype' => 'read',
1135 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1136 'archetypes' => array(
4f0c2d00 1137 'manager' => CAP_ALLOW
05de723b
NC
1138 )
1139 ),
1140
5a8ab2e9 1141 'moodle/blog:create' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 1142
21b6db6e 1143 'riskbitmask' => RISK_SPAM,
1144
bbbf2d40 1145 'captype' => 'write',
1146 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1147 'archetypes' => array(
c785d40a 1148 'user' => CAP_ALLOW,
4f0c2d00 1149 'manager' => CAP_ALLOW
bbbf2d40 1150 )
1151 ),
eef868d1 1152
bbbf2d40 1153 'moodle/blog:manageentries' => array(
1154
21b6db6e 1155 'riskbitmask' => RISK_SPAM,
1156
bbbf2d40 1157 'captype' => 'write',
05de723b 1158 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1159 'archetypes' => array(
bbbf2d40 1160 'teacher' => CAP_ALLOW,
1161 'editingteacher' => CAP_ALLOW,
4f0c2d00 1162 'manager' => CAP_ALLOW
bbbf2d40 1163 )
1164 ),
05de723b 1165
cae83708 1166 'moodle/blog:manageexternal' => array(
1167
1168 'riskbitmask' => RISK_SPAM,
1169
1170 'captype' => 'write',
296f6c99 1171 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1172 'archetypes' => array(
cae83708 1173 'student' => CAP_ALLOW,
1174 'user' => CAP_ALLOW,
1175 'teacher' => CAP_ALLOW,
1176 'editingteacher' => CAP_ALLOW,
4f0c2d00 1177 'manager' => CAP_ALLOW
cae83708 1178 )
1179 ),
1180
4ef08298 1181 // TODO: Remove 'moodle/blog:associatecourse' and 'moodle/blog:associatemodule' after a few releases.
05de723b
NC
1182 'moodle/blog:associatecourse' => array(
1183
1184 'captype' => 'write',
1185 'contextlevel' => CONTEXT_COURSE,
4ef08298 1186 'archetypes' => array()
05de723b
NC
1187 ),
1188
1189 'moodle/blog:associatemodule' => array(
1190
1191 'captype' => 'write',
1192 'contextlevel' => CONTEXT_MODULE,
4ef08298 1193 'archetypes' => array()
05de723b 1194 ),
eef868d1 1195
5a8ab2e9 1196 'moodle/calendar:manageownentries' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 1197
21b6db6e 1198 'riskbitmask' => RISK_SPAM,
1199
bbbf2d40 1200 'captype' => 'write',
f432bebf 1201 'contextlevel' => CONTEXT_COURSE,
31c93303 1202 'archetypes' => array(
c785d40a 1203 'user' => CAP_ALLOW,
4f0c2d00 1204 'manager' => CAP_ALLOW
bbbf2d40 1205 )
1206 ),
eef868d1 1207
f63d2922 1208 'moodle/calendar:managegroupentries' => array(
1209
1210 'riskbitmask' => RISK_SPAM,
1211
1212 'captype' => 'write',
f432bebf 1213 'contextlevel' => CONTEXT_COURSE,
31c93303 1214 'archetypes' => array(
f63d2922 1215 'teacher' => CAP_ALLOW,
1216 'editingteacher' => CAP_ALLOW,
4f0c2d00 1217 'manager' => CAP_ALLOW
f63d2922 1218 )
1219 ),
1220
bbbf2d40 1221 'moodle/calendar:manageentries' => array(
1222
21b6db6e 1223 'riskbitmask' => RISK_SPAM,
1224
bbbf2d40 1225 'captype' => 'write',
f432bebf 1226 'contextlevel' => CONTEXT_COURSE,
31c93303 1227 'archetypes' => array(
bbbf2d40 1228 'teacher' => CAP_ALLOW,
1229 'editingteacher' => CAP_ALLOW,
4f0c2d00 1230 'manager' => CAP_ALLOW
bbbf2d40 1231 )
77d4953e 1232 ),
a044c05d 1233
1234 'moodle/user:editprofile' => array(
1235
3a0c6cca 1236 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
a044c05d 1237
1238 'captype' => 'write',
1239 'contextlevel' => CONTEXT_USER,
31c93303 1240 'archetypes' => array(
4f0c2d00 1241 'manager' => CAP_ALLOW
a044c05d 1242 )
1243 ),
eef868d1 1244
a5b8be62 1245 'moodle/user:editownprofile' => array(
1cb3da36 1246
3a0c6cca 1247 'riskbitmask' => RISK_SPAM,
1248
a5b8be62 1249 'captype' => 'write',
1250 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1251 'archetypes' => array(
1cb3da36 1252 'guest' => CAP_PROHIBIT,
1253 'user' => CAP_ALLOW,
4f0c2d00 1254 'manager' => CAP_ALLOW
a5b8be62 1255 )
1cb3da36 1256 ),
1257
a5b8be62 1258 'moodle/user:changeownpassword' => array(
1cb3da36 1259
a5b8be62 1260 'captype' => 'write',
1261 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1262 'archetypes' => array(
1cb3da36 1263 'guest' => CAP_PROHIBIT,
1264 'user' => CAP_ALLOW,
4f0c2d00 1265 'manager' => CAP_ALLOW
a5b8be62 1266 )
1cb3da36 1267 ),
1268
eef868d1 1269 // The next 3 might make no sense for some roles, e.g teacher, etc.
77d4953e 1270 // since the next level up is site. These are more for the parent role
1271 'moodle/user:readuserposts' => array(
bcdb0f19 1272
77d4953e 1273 'captype' => 'read',
4b10f08b 1274 'contextlevel' => CONTEXT_USER,
31c93303 1275 'archetypes' => array(
77d4953e 1276 'student' => CAP_ALLOW,
1277 'teacher' => CAP_ALLOW,
1278 'editingteacher' => CAP_ALLOW,
4f0c2d00 1279 'manager' => CAP_ALLOW
77d4953e 1280 )
1281 ),
eef868d1 1282
77d4953e 1283 'moodle/user:readuserblogs' => array(
bcdb0f19 1284
77d4953e 1285 'captype' => 'read',
4b10f08b 1286 'contextlevel' => CONTEXT_USER,
31c93303 1287 'archetypes' => array(
77d4953e 1288 'student' => CAP_ALLOW,
1289 'teacher' => CAP_ALLOW,
1290 'editingteacher' => CAP_ALLOW,
4f0c2d00 1291 'manager' => CAP_ALLOW
77d4953e 1292 )
1293 ),
eef868d1 1294
3c7da16d 1295 // designed for parent role - not used in legacy roles
77d4953e 1296 'moodle/user:viewuseractivitiesreport' => array(
3c7da16d 1297 'riskbitmask' => RISK_PERSONAL,
bcdb0f19 1298
77d4953e 1299 'captype' => 'read',
4b10f08b 1300 'contextlevel' => CONTEXT_USER,
31c93303 1301 'archetypes' => array(
77d4953e 1302 )
945f88ca 1303 ),
4e781c7b 1304
3b120e46 1305 //capabilities designed for the new message system configuration
1306 'moodle/user:editmessageprofile' => array(
f7c0d84b 1307
3b120e46 1308 'riskbitmask' => RISK_SPAM,
f7c0d84b 1309
3b120e46 1310 'captype' => 'write',
1311 'contextlevel' => CONTEXT_USER,
31c93303 1312 'archetypes' => array(
4f0c2d00 1313 'manager' => CAP_ALLOW
3b120e46 1314 )
1315 ),
f7c0d84b 1316
1317 'moodle/user:editownmessageprofile' => array(
1318
1319 'captype' => 'write',
1320 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1321 'archetypes' => array(
3b120e46 1322 'guest' => CAP_PROHIBIT,
1323 'user' => CAP_ALLOW,
4f0c2d00 1324 'manager' => CAP_ALLOW
f7c0d84b 1325 )
3b120e46 1326 ),
eef868d1 1327
271e6dec 1328 'moodle/question:managecategory' => array(
14d701d6 1329 'riskbitmask' => RISK_SPAM | RISK_XSS,
945f88ca 1330 'captype' => 'write',
1331 'contextlevel' => CONTEXT_COURSE,
31c93303 1332 'archetypes' => array(
945f88ca 1333 'editingteacher' => CAP_ALLOW,
4f0c2d00 1334 'manager' => CAP_ALLOW
945f88ca 1335 )
a5b8be62 1336 ),
1337
271e6dec 1338 //new in moodle 1.9
1339 'moodle/question:add' => array(
14d701d6 1340 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1341 'captype' => 'write',
1342 'contextlevel' => CONTEXT_COURSE,
31c93303 1343 'archetypes' => array(
271e6dec 1344 'editingteacher' => CAP_ALLOW,
4f0c2d00 1345 'manager' => CAP_ALLOW
271e6dec 1346 ),
1347 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1348 ),
271e6dec 1349 'moodle/question:editmine' => array(
14d701d6 1350 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1351 'captype' => 'write',
1352 'contextlevel' => CONTEXT_COURSE,
31c93303 1353 'archetypes' => array(
271e6dec 1354 'editingteacher' => CAP_ALLOW,
4f0c2d00 1355 'manager' => CAP_ALLOW
271e6dec 1356 ),
a5b8be62 1357 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1358 ),
1359 'moodle/question:editall' => array(
14d701d6 1360 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1361 'captype' => 'write',
1362 'contextlevel' => CONTEXT_COURSE,
31c93303 1363 'archetypes' => array(
271e6dec 1364 'editingteacher' => CAP_ALLOW,
4f0c2d00 1365 'manager' => CAP_ALLOW
271e6dec 1366 ),
a5b8be62 1367 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1368 ),
1369 'moodle/question:viewmine' => array(
945f88ca 1370 'captype' => 'read',
1371 'contextlevel' => CONTEXT_COURSE,
31c93303 1372 'archetypes' => array(
945f88ca 1373 'editingteacher' => CAP_ALLOW,
4f0c2d00 1374 'manager' => CAP_ALLOW
271e6dec 1375 ),
a5b8be62 1376 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1377 ),
271e6dec 1378 'moodle/question:viewall' => array(
1379 'captype' => 'read',
1380 'contextlevel' => CONTEXT_COURSE,
31c93303 1381 'archetypes' => array(
271e6dec 1382 'editingteacher' => CAP_ALLOW,
4f0c2d00 1383 'manager' => CAP_ALLOW
271e6dec 1384 ),
a5b8be62 1385 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1386 ),
1387 'moodle/question:usemine' => array(
1388 'captype' => 'read',
1389 'contextlevel' => CONTEXT_COURSE,
31c93303 1390 'archetypes' => array(
271e6dec 1391 'editingteacher' => CAP_ALLOW,
4f0c2d00 1392 'manager' => CAP_ALLOW
271e6dec 1393 ),
a5b8be62 1394 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1395 ),
1396 'moodle/question:useall' => array(
1397 'captype' => 'read',
1398 'contextlevel' => CONTEXT_COURSE,
31c93303 1399 'archetypes' => array(
271e6dec 1400 'editingteacher' => CAP_ALLOW,
4f0c2d00 1401 'manager' => CAP_ALLOW
271e6dec 1402 ),
a5b8be62 1403 'clonepermissionsfrom' => 'moodle/question:manage'
1404 ),
271e6dec 1405 'moodle/question:movemine' => array(
945f88ca 1406 'captype' => 'write',
1407 'contextlevel' => CONTEXT_COURSE,
31c93303 1408 'archetypes' => array(
945f88ca 1409 'editingteacher' => CAP_ALLOW,
4f0c2d00 1410 'manager' => CAP_ALLOW
271e6dec 1411 ),
a5b8be62 1412 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1413 ),
271e6dec 1414 'moodle/question:moveall' => array(
945f88ca 1415 'captype' => 'write',
1416 'contextlevel' => CONTEXT_COURSE,
31c93303 1417 'archetypes' => array(
945f88ca 1418 'editingteacher' => CAP_ALLOW,
4f0c2d00 1419 'manager' => CAP_ALLOW
271e6dec 1420 ),
a5b8be62 1421 'clonepermissionsfrom' => 'moodle/question:manage'
7191a1fa 1422 ),
271e6dec 1423 //END new in moodle 1.9
a5b8be62 1424
0eb6b04a 1425 // Configure the installed question types.
1426 'moodle/question:config' => array(
0eb6b04a 1427 'riskbitmask' => RISK_CONFIG,
0eb6b04a 1428 'captype' => 'write',
1429 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1430 'archetypes' => array(
4f0c2d00 1431 'manager' => CAP_ALLOW
0eb6b04a 1432 )
1433 ),
1434
62e76c67 1435 // While attempting questions, the ability to flag particular questions for later reference.
1436 'moodle/question:flag' => array(
1437 'captype' => 'write',
1438 'contextlevel' => CONTEXT_COURSE,
31c93303 1439 'archetypes' => array(
62e76c67 1440 'student' => CAP_ALLOW,
1441 'teacher' => CAP_ALLOW,
1442 'editingteacher' => CAP_ALLOW,
4f0c2d00 1443 'manager' => CAP_ALLOW
62e76c67 1444 )
1445 ),
bcdb0f19 1446
62e76c67 1447 'moodle/site:doclinks' => array(
7191a1fa 1448 'captype' => 'read',
1449 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1450 'archetypes' => array(
7191a1fa 1451 'teacher' => CAP_ALLOW,
1452 'editingteacher' => CAP_ALLOW,
4f0c2d00 1453 'manager' => CAP_ALLOW
7191a1fa 1454 )
3924b988 1455 ),
eef868d1 1456
3924b988 1457 'moodle/course:sectionvisibility' => array(
bcdb0f19 1458
3924b988 1459 'captype' => 'write',
1460 'contextlevel' => CONTEXT_COURSE,
31c93303 1461 'archetypes' => array(
3924b988 1462 'editingteacher' => CAP_ALLOW,
4f0c2d00 1463 'manager' => CAP_ALLOW
3924b988 1464 )
1465 ),
eef868d1 1466
dc558690 1467 'moodle/course:useremail' => array(
bcdb0f19 1468
dc558690 1469 'captype' => 'write',
1470 'contextlevel' => CONTEXT_COURSE,
31c93303 1471 'archetypes' => array(
dc558690 1472 'editingteacher' => CAP_ALLOW,
4f0c2d00 1473 'manager' => CAP_ALLOW
dc558690 1474 )
1475 ),
eef868d1 1476
3924b988 1477 'moodle/course:viewhiddensections' => array(
bcdb0f19 1478
3924b988 1479 'captype' => 'write',
1480 'contextlevel' => CONTEXT_COURSE,
31c93303 1481 'archetypes' => array(
3924b988 1482 'editingteacher' => CAP_ALLOW,
4f0c2d00 1483 'manager' => CAP_ALLOW
3924b988 1484 )
1485 ),
eef868d1 1486
3924b988 1487 'moodle/course:setcurrentsection' => array(
bcdb0f19 1488
3924b988 1489 'captype' => 'write',
1490 'contextlevel' => CONTEXT_COURSE,
31c93303 1491 'archetypes' => array(
3924b988 1492 'editingteacher' => CAP_ALLOW,
4f0c2d00 1493 'manager' => CAP_ALLOW
3924b988 1494 )
1495 ),
eef868d1 1496
ad778c84
FM
1497 'moodle/course:movesections' => array(
1498
1499 'captype' => 'write',
1500 'contextlevel' => CONTEXT_COURSE,
1501 'archetypes' => array(
1502 'editingteacher' => CAP_ALLOW,
1503 'manager' => CAP_ALLOW
1504 ),
1505 'clonepermissionsfrom' => 'moodle/course:update'
1506 ),
1507
dd45888a 1508 'moodle/site:mnetlogintoremote' => array(
bc4c9800 1509
3924b988 1510 'captype' => 'read',
dd45888a 1511 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1512 'archetypes' => array(
3924b988 1513 )
1514 ),
eef868d1 1515
dd45888a 1516 'moodle/grade:viewall' => array(
bcdb0f19 1517 'riskbitmask' => RISK_PERSONAL,
dd45888a 1518 'captype' => 'read',
eecf76df 1519 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_USER
31c93303 1520 'archetypes' => array(
dd45888a 1521 'teacher' => CAP_ALLOW,
3924b988 1522 'editingteacher' => CAP_ALLOW,
4f0c2d00 1523 'manager' => CAP_ALLOW
dd45888a 1524 ),
1525 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
f509ce06 1526 ),
f43ce1ad 1527
dd45888a 1528 'moodle/grade:view' => array(
f509ce06 1529 'captype' => 'read',
eecf76df 1530 'contextlevel' => CONTEXT_COURSE,
31c93303 1531 'archetypes' => array(
dd45888a 1532 'student' => CAP_ALLOW
f509ce06 1533 )
ca9ffa18 1534 ),
dd45888a 1535
1536 'moodle/grade:viewhidden' => array(
ca9ffa18 1537 'riskbitmask' => RISK_PERSONAL,
1538 'captype' => 'read',
eecf76df 1539 'contextlevel' => CONTEXT_COURSE,
31c93303 1540 'archetypes' => array(
0371f8e5 1541 'teacher' => CAP_ALLOW,
1542 'editingteacher' => CAP_ALLOW,
4f0c2d00 1543 'manager' => CAP_ALLOW
dd45888a 1544 ),
1545 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
ca9ffa18 1546 ),
dd45888a 1547
1548 'moodle/grade:import' => array(
3a0c6cca 1549 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
dd45888a 1550 'captype' => 'write',
ca9ffa18 1551 'contextlevel' => CONTEXT_COURSE,
31c93303 1552 'archetypes' => array(
ca9ffa18 1553 'editingteacher' => CAP_ALLOW,
4f0c2d00 1554 'manager' => CAP_ALLOW
dd45888a 1555 ),
1556 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1557 ),
dd45888a 1558
1559 'moodle/grade:export' => array(
ca9ffa18 1560 'riskbitmask' => RISK_PERSONAL,
1561 'captype' => 'read',
1562 'contextlevel' => CONTEXT_COURSE,
31c93303 1563 'archetypes' => array(
ca9ffa18 1564 'teacher' => CAP_ALLOW,
1565 'editingteacher' => CAP_ALLOW,
4f0c2d00 1566 'manager' => CAP_ALLOW
dd45888a 1567 ),
1568 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1569 ),
dd45888a 1570
1571 'moodle/grade:manage' => array(
3a0c6cca 1572 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
dd45888a 1573 'captype' => 'write',
1574 'contextlevel' => CONTEXT_COURSE,
31c93303 1575 'archetypes' => array(
dd45888a 1576 'editingteacher' => CAP_ALLOW,
4f0c2d00 1577 'manager' => CAP_ALLOW
dd45888a 1578 ),
1579 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1580 ),
dd45888a 1581
a5b8be62 1582 'moodle/grade:edit' => array(
1583 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
04259694 1584 'captype' => 'write',
1585 'contextlevel' => CONTEXT_COURSE,
31c93303 1586 'archetypes' => array(
04259694 1587 'editingteacher' => CAP_ALLOW,
4f0c2d00 1588 'manager' => CAP_ALLOW
04259694 1589 ),
1590 'clonepermissionsfrom' => 'moodle/course:managegrades'
1591 ),
1592
86e9ccfd
DM
1593 // ability to define advanced grading forms in activities either from scratch
1594 // or from a shared template
f25a5a32
DM
1595 'moodle/grade:managegradingforms' => array(
1596 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
1597 'captype' => 'write',
553af5fd 1598 'contextlevel' => CONTEXT_COURSE,
f25a5a32
DM
1599 'archetypes' => array(
1600 'editingteacher' => CAP_ALLOW,
1601 'manager' => CAP_ALLOW
1602 ),
1603 'clonepermissionsfrom' => 'moodle/course:managegrades'
04259694 1604 ),
1605
86e9ccfd
DM
1606 // ability to save a grading form as a new shared template and eventually edit
1607 // and remove own templates (templates originally shared by that user)
553af5fd 1608 'moodle/grade:sharegradingforms' => array(
86e9ccfd
DM
1609 'riskbitmask' => RISK_XSS,
1610 'captype' => 'write',
1611 'contextlevel' => CONTEXT_SYSTEM,
1612 'archetypes' => array(
1613 'manager' => CAP_ALLOW
1614 ),
1615 ),
1616
1617 // ability to edit and remove any shared template, even those originally shared
1618 // by other users
1619 'moodle/grade:managesharedforms' => array(
1620 'riskbitmask' => RISK_XSS,
553af5fd
DM
1621 'captype' => 'write',
1622 'contextlevel' => CONTEXT_SYSTEM,
1623 'archetypes' => array(
1624 'manager' => CAP_ALLOW
1625 ),
1626 ),
1627
a5b8be62 1628 'moodle/grade:manageoutcomes' => array(
284abb09 1629 'captype' => 'write',
1630 'contextlevel' => CONTEXT_COURSE,
31c93303 1631 'archetypes' => array(
284abb09 1632 'editingteacher' => CAP_ALLOW,
4f0c2d00 1633 'manager' => CAP_ALLOW
284abb09 1634 ),
1635 'clonepermissionsfrom' => 'moodle/course:managegrades'
1636 ),
1637
1638 'moodle/grade:manageletters' => array(
ca9ffa18 1639 'captype' => 'write',
1640 'contextlevel' => CONTEXT_COURSE,
31c93303 1641 'archetypes' => array(
ca9ffa18 1642 'editingteacher' => CAP_ALLOW,
4f0c2d00 1643 'manager' => CAP_ALLOW
a5b8be62 1644 ),
1645 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1646 ),
dd45888a 1647
a5b8be62 1648 'moodle/grade:hide' => array(
ca9ffa18 1649 'captype' => 'write',
1650 'contextlevel' => CONTEXT_COURSE,
31c93303 1651 'archetypes' => array(
ca9ffa18 1652 'editingteacher' => CAP_ALLOW,
4f0c2d00 1653 'manager' => CAP_ALLOW
ca9ffa18 1654 )
1655 ),
dd45888a 1656
a5b8be62 1657 'moodle/grade:lock' => array(
dd45888a 1658 'captype' => 'write',
ca9ffa18 1659 'contextlevel' => CONTEXT_COURSE,
31c93303 1660 'archetypes' => array(
ca9ffa18 1661 'editingteacher' => CAP_ALLOW,
4f0c2d00 1662 'manager' => CAP_ALLOW
ca9ffa18 1663 )
1664 ),
dd45888a 1665
a5b8be62 1666 'moodle/grade:unlock' => array(
ca9ffa18 1667 'captype' => 'write',
1668 'contextlevel' => CONTEXT_COURSE,
31c93303 1669 'archetypes' => array(
ca9ffa18 1670 'editingteacher' => CAP_ALLOW,
4f0c2d00 1671 'manager' => CAP_ALLOW
ca9ffa18 1672 )
282c1695 1673 ),
dd45888a 1674
1675 'moodle/my:manageblocks' => array(
282c1695 1676 'captype' => 'write',
1677 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1678 'archetypes' => array(
282c1695 1679 'user' => CAP_ALLOW
1680 )
eca3af25 1681 ),
dd45888a 1682
eca3af25 1683 'moodle/notes:view' => array(
1684 'captype' => 'read',
f432bebf 1685 'contextlevel' => CONTEXT_COURSE,
31c93303 1686 'archetypes' => array(
eca3af25 1687 'teacher' => CAP_ALLOW,
1688 'editingteacher' => CAP_ALLOW,
4f0c2d00 1689 'manager' => CAP_ALLOW
eca3af25 1690 )
1691 ),
1692
1693 'moodle/notes:manage' => array(
3a0c6cca 1694 'riskbitmask' => RISK_SPAM,
1695
eca3af25 1696 'captype' => 'write',
f432bebf 1697 'contextlevel' => CONTEXT_COURSE,
31c93303 1698 'archetypes' => array(
eca3af25 1699 'teacher' => CAP_ALLOW,
1700 'editingteacher' => CAP_ALLOW,
4f0c2d00 1701 'manager' => CAP_ALLOW
eca3af25 1702 )
dd45888a 1703 ),
79642064 1704
1705 'moodle/tag:manage' => array(
3a0c6cca 1706 'riskbitmask' => RISK_SPAM,
1707
79642064 1708 'captype' => 'write',
1709 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1710 'archetypes' => array(
4f0c2d00 1711 'manager' => CAP_ALLOW
79642064 1712 )
705789bd 1713 ),
1714
705789bd 1715 'moodle/tag:edit' => array(
3a0c6cca 1716 'riskbitmask' => RISK_SPAM,
1717
705789bd 1718 'captype' => 'write',
1719 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1720 'archetypes' => array(
dd8a0a39 1721 'manager' => CAP_ALLOW
98b5789d 1722 )
1723 ),
a5b8be62 1724
7dd764b8
JG
1725 'moodle/tag:flag' => array(
1726 'riskbitmask' => RISK_SPAM,
1727
1728 'captype' => 'write',
1729 'contextlevel' => CONTEXT_SYSTEM,
1730 'archetypes' => array(
7dd764b8
JG
1731 'user' => CAP_ALLOW
1732 )
1733 ),
1734
98b5789d 1735 'moodle/tag:editblocks' => array(
1736 'captype' => 'write',
1737 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1738 'archetypes' => array(
705789bd 1739 'teacher' => CAP_ALLOW,
1740 'editingteacher' => CAP_ALLOW,
4f0c2d00 1741 'manager' => CAP_ALLOW
705789bd 1742 )
7e874772 1743 ),
1744
1745 'moodle/block:view' => array(
1746 'captype' => 'read',
1747 'contextlevel' => CONTEXT_BLOCK,
31c93303 1748 'archetypes' => array(
7e874772 1749 'guest' => CAP_ALLOW,
25a7d980 1750 'user' => CAP_ALLOW,
1751 'student' => CAP_ALLOW,
1752 'teacher' => CAP_ALLOW,
1753 'editingteacher' => CAP_ALLOW,
7e874772 1754 )
8512f577 1755 ),
1756
d14edf06 1757 'moodle/block:edit' => array(
1758 'riskbitmask' => RISK_SPAM | RISK_XSS,
1759
1760 'captype' => 'write',
1761 'contextlevel' => CONTEXT_BLOCK,
31c93303 1762 'archetypes' => array(
d14edf06 1763 'editingteacher' => CAP_ALLOW,
586e7976 1764 'manager' => CAP_ALLOW
d14edf06 1765 )
1766 ),
1767
8512f577 1768 'moodle/portfolio:export' => array(
1769 'captype' => 'read',
1770 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1771 'archetypes' => array(
8512f577 1772 'user' => CAP_ALLOW,
1773 'student' => CAP_ALLOW,
1774 'teacher' => CAP_ALLOW,
1775 'editingteacher' => CAP_ALLOW,
8512f577 1776 )
1bcb7eb5 1777 ),
1778 'moodle/comment:view' => array(
1bcb7eb5 1779 'captype' => 'read',
ad0ae261 1780 'contextlevel' => CONTEXT_COURSE,
31c93303 1781 'archetypes' => array(
b3da2877
SH
1782 'frontpage' => CAP_ALLOW,
1783 'guest' => CAP_ALLOW,
1bcb7eb5 1784 'user' => CAP_ALLOW,
1785 'student' => CAP_ALLOW,
1786 'teacher' => CAP_ALLOW,
1787 'editingteacher' => CAP_ALLOW,
4f0c2d00 1788 'manager' => CAP_ALLOW
1bcb7eb5 1789 )
1790 ),
1791 'moodle/comment:post' => array(
1792
1793 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
1794 'captype' => 'write',
ad0ae261 1795 'contextlevel' => CONTEXT_COURSE,
31c93303 1796 'archetypes' => array(
1bcb7eb5 1797 'user' => CAP_ALLOW,
1798 'student' => CAP_ALLOW,
1799 'teacher' => CAP_ALLOW,
1800 'editingteacher' => CAP_ALLOW,
4f0c2d00 1801 'manager' => CAP_ALLOW
1bcb7eb5 1802 )
1803 ),
1804 'moodle/comment:delete' => array(
1805
1806 'riskbitmask' => RISK_DATALOSS,
1807 'captype' => 'write',
ad0ae261 1808 'contextlevel' => CONTEXT_COURSE,
31c93303 1809 'archetypes' => array(
1bcb7eb5 1810 'editingteacher' => CAP_ALLOW,
4f0c2d00 1811 'manager' => CAP_ALLOW
1bcb7eb5 1812 )
5eacbd4b 1813 ),
1814 'moodle/webservice:createtoken' => array(
1815
52dd27bf 1816 'riskbitmask' => RISK_CONFIG | RISK_DATALOSS | RISK_SPAM | RISK_PERSONAL | RISK_XSS,
5eacbd4b 1817 'captype' => 'write',
1818 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1819 'archetypes' => array(
4f0c2d00 1820 'manager' => CAP_ALLOW
5eacbd4b 1821 )
a09aeee4 1822 ),
13ea96c4
DC
1823 'moodle/webservice:createmobiletoken' => array(
1824
f2eac756 1825 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
13ea96c4
DC
1826 'captype' => 'write',
1827 'contextlevel' => CONTEXT_SYSTEM,
1828 'archetypes' => array(
1829 'user' => CAP_ALLOW
1830 )
1831 ),
19fae119 1832 'moodle/rating:view' => array(
ad0ae261 1833
a09aeee4 1834 'captype' => 'read',
ad0ae261 1835 'contextlevel' => CONTEXT_COURSE,
31c93303 1836 'archetypes' => array(
ad0ae261 1837 'user' => CAP_ALLOW,
e116a818
AD
1838 'student' => CAP_ALLOW,
1839 'teacher' => CAP_ALLOW,
1840 'editingteacher' => CAP_ALLOW,
4f0c2d00 1841 'manager' => CAP_ALLOW
a09aeee4
AD
1842 )
1843 ),
6595a568 1844 'moodle/rating:viewany' => array(
ad0ae261 1845
6595a568
MD
1846 'riskbitmask' => RISK_PERSONAL,
1847 'captype' => 'read',
ad0ae261 1848 'contextlevel' => CONTEXT_COURSE,
31c93303 1849 'archetypes' => array(
ad0ae261 1850 'user' => CAP_ALLOW,
6595a568
MD
1851 'student' => CAP_ALLOW,
1852 'teacher' => CAP_ALLOW,
1853 'editingteacher' => CAP_ALLOW,
1854 'manager' => CAP_ALLOW
1855 )
1856 ),
19fae119 1857 'moodle/rating:viewall' => array(
ad0ae261 1858
a09aeee4
AD
1859 'riskbitmask' => RISK_PERSONAL,
1860 'captype' => 'read',
ad0ae261 1861 'contextlevel' => CONTEXT_COURSE,
31c93303 1862 'archetypes' => array(
ad0ae261 1863 'user' => CAP_ALLOW,
6595a568 1864 'student' => CAP_ALLOW,
e116a818
AD
1865 'teacher' => CAP_ALLOW,
1866 'editingteacher' => CAP_ALLOW,
4f0c2d00 1867 'manager' => CAP_ALLOW
a09aeee4
AD
1868 )
1869 ),
19fae119 1870 'moodle/rating:rate' => array(
ad0ae261 1871
a09aeee4 1872 'captype' => 'write',
ad0ae261 1873 'contextlevel' => CONTEXT_COURSE,
31c93303 1874 'archetypes' => array(
ad0ae261 1875 'user' => CAP_ALLOW,
6595a568 1876 'student' => CAP_ALLOW,
e116a818
AD
1877 'teacher' => CAP_ALLOW,
1878 'editingteacher' => CAP_ALLOW,
4f0c2d00 1879 'manager' => CAP_ALLOW
a09aeee4 1880 )
07ab0c80 1881 ),
1882 'moodle/course:publish' => array(
1883
07ab0c80 1884 'captype' => 'write',
ad0ae261 1885 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
07ab0c80 1886 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1887 'archetypes' => array(
07ab0c80 1888 'manager' => CAP_ALLOW
1889 )
2be4d090
MD
1890 ),
1891 'moodle/course:markcomplete' => array(
1892 'captype' => 'write',
1893 'contextlevel' => CONTEXT_COURSE,
31c93303 1894 'archetypes' => array(
2be4d090
MD
1895 'teacher' => CAP_ALLOW,
1896 'editingteacher' => CAP_ALLOW,
2be4d090
MD
1897 'manager' => CAP_ALLOW
1898 )
755f96f8 1899 ),
1900 'moodle/community:add' => array(
1901 'captype' => 'write',
1902 'contextlevel' => CONTEXT_SYSTEM,
1903 'archetypes' => array(
1904 'manager' => CAP_ALLOW,
1905 'teacher' => CAP_ALLOW,
17957b8f 1906 'editingteacher' => CAP_ALLOW,
755f96f8 1907 )
1908 ),
1909 'moodle/community:download' => array(
1910 'captype' => 'write',
1911 'contextlevel' => CONTEXT_SYSTEM,
1912 'archetypes' => array(
1913 'manager' => CAP_ALLOW,
17957b8f 1914 'editingteacher' => CAP_ALLOW,
755f96f8 1915 )
27806552
YB
1916 ),
1917
1918 // Badges.
1919 'moodle/badges:manageglobalsettings' => array(
1920 'riskbitmask' => RISK_DATALOSS | RISK_CONFIG,
1921 'captype' => 'write',
1922 'contextlevel' => CONTEXT_SYSTEM,
1923 'archetypes' => array(
1924 'manager' => CAP_ALLOW,
27806552
YB
1925 )
1926 ),
1927
1928 // View available badges without earning them.
1929 'moodle/badges:viewbadges' => array(
1930 'captype' => 'read',
3e9f4c7b 1931 'contextlevel' => CONTEXT_COURSE,
27806552 1932 'archetypes' => array(
27806552 1933 'user' => CAP_ALLOW,
27806552
YB
1934 )
1935 ),
1936
1937 // Manage badges on own private badges page.
1938 'moodle/badges:manageownbadges' => array(
3e9f4c7b 1939 'riskbitmap' => RISK_SPAM,
27806552 1940 'captype' => 'write',
3e9f4c7b 1941 'contextlevel' => CONTEXT_USER,
27806552
YB
1942 'archetypes' => array(
1943 'user' => CAP_ALLOW
1944 )
1945 ),
1946
1947 // View public badges in other users' profiles.
1948 'moodle/badges:viewotherbadges' => array(
1949 'riskbitmap' => RISK_PERSONAL,
1950 'captype' => 'read',
1951 'contextlevel' => CONTEXT_USER,
1952 'archetypes' => array(
1953 'user' => CAP_ALLOW
1954 )
1955 ),
1956
1957 // Earn badge.
1958 'moodle/badges:earnbadge' => array(
1959 'captype' => 'write',
3e9f4c7b 1960 'contextlevel' => CONTEXT_COURSE,
27806552
YB
1961 'archetypes' => array(
1962 'user' => CAP_ALLOW,
27806552
YB
1963 )
1964 ),
1965
1966 // Create/duplicate badges.
1967 'moodle/badges:createbadge' => array(
3e9f4c7b 1968 'riskbitmask' => RISK_SPAM,
27806552 1969 'captype' => 'write',
3e9f4c7b 1970 'contextlevel' => CONTEXT_COURSE,
27806552
YB
1971 'archetypes' => array(
1972 'manager' => CAP_ALLOW,
27806552 1973 'editingteacher' => CAP_ALLOW,
27806552
YB
1974 )
1975 ),
1976
1977 // Delete badges.
1978 'moodle/badges:deletebadge' => array(
3e9f4c7b 1979 'riskbitmask' => RISK_DATALOSS,
27806552 1980 'captype' => 'write',
3e9f4c7b 1981 'contextlevel' => CONTEXT_COURSE,
27806552
YB
1982 'archetypes' => array(
1983 'manager' => CAP_ALLOW,
27806552 1984 'editingteacher' => CAP_ALLOW,
27806552
YB
1985 )
1986 ),
1987
1988 // Set up/edit badge details.
1989 'moodle/badges:configuredetails' => array(
3e9f4c7b 1990 'riskbitmask' => RISK_SPAM,
27806552 1991 'captype' => 'write',
3e9f4c7b 1992 'contextlevel' => CONTEXT_COURSE,
27806552
YB
1993 'archetypes' => array(
1994 'manager' => CAP_ALLOW,
27806552 1995 'editingteacher' => CAP_ALLOW,
27806552
YB
1996 )
1997 ),
1998
1999 // Set up/edit criteria of earning a badge.
2000 'moodle/badges:configurecriteria' => array(
0b6ba27a 2001 'riskbitmask' => RISK_XSS,
27806552 2002 'captype' => 'write',
3e9f4c7b 2003 'contextlevel' => CONTEXT_COURSE,
27806552
YB
2004 'archetypes' => array(
2005 'manager' => CAP_ALLOW,
27806552 2006 'editingteacher' => CAP_ALLOW,
27806552
YB
2007 )
2008 ),
2009
2010 // Configure badge messages.
2011 'moodle/badges:configuremessages' => array(
3e9f4c7b 2012 'riskbitmask' => RISK_SPAM,
27806552 2013 'captype' => 'write',
3e9f4c7b 2014 'contextlevel' => CONTEXT_COURSE,
27806552
YB
2015 'archetypes' => array(
2016 'manager' => CAP_ALLOW,
27806552 2017 'editingteacher' => CAP_ALLOW,
27806552
YB
2018 )
2019 ),
2020
2021 // Award badge to a user.
2022 'moodle/badges:awardbadge' => array(
2023 'riskbitmask' => RISK_SPAM,
2024 'captype' => 'write',
3e9f4c7b 2025 'contextlevel' => CONTEXT_COURSE,
27806552
YB
2026 'archetypes' => array(
2027 'manager' => CAP_ALLOW,
27806552
YB
2028 'teacher' => CAP_ALLOW,
2029 'editingteacher' => CAP_ALLOW,
27806552
YB
2030 )
2031 ),
2032
2033 // View users who earned a specific badge without being able to award a badge.
2034 'moodle/badges:viewawarded' => array(
2035 'riskbitmask' => RISK_PERSONAL,
2036 'captype' => 'read',
3e9f4c7b 2037 'contextlevel' => CONTEXT_COURSE,
27806552
YB
2038 'archetypes' => array(
2039 'manager' => CAP_ALLOW,
2040 'teacher' => CAP_ALLOW,
2041 'editingteacher' => CAP_ALLOW,
2042 )
c484af5a
BK
2043 ),
2044
2045 'moodle/site:forcelanguage' => array(
2046 'captype' => 'read',
2047 'contextlevel' => CONTEXT_SYSTEM,
2048 'archetypes' => array(
2049 )
79642064 2050 )
bbbf2d40 2051);