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