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