Merge branch 'wip-mdl-31969' of git://github.com/rajeshtaneja/moodle
[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
e58eca72 508 'moodle/user:viewhiddendetails' => array(
eef868d1 509
21b6db6e 510 'riskbitmask' => RISK_PERSONAL,
511
e58eca72 512 'captype' => 'read',
f432bebf 513 'contextlevel' => CONTEXT_COURSE,
31c93303 514 'archetypes' => array(
e58eca72 515 'teacher' => CAP_ALLOW,
516 'editingteacher' => CAP_ALLOW,
4f0c2d00 517 'manager' => CAP_ALLOW
e58eca72 518 )
519 ),
eef868d1 520
6c95827f 521 'moodle/user:loginas' => array(
522
523 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
524
525 'captype' => 'write',
526 'contextlevel' => CONTEXT_COURSE,
31c93303 527 'archetypes' => array(
4f0c2d00 528 'manager' => CAP_ALLOW
6c95827f 529 )
530 ),
531
03d9401e
MD
532 // can the user manage the system default profile page?
533 'moodle/user:managesyspages' => array(
534
535 'riskbitmap' => RISK_SPAM | RISK_PERSONAL | RISK_CONFIG,
536
537 'captype' => 'write',
538 'contextlevel' => CONTEXT_SYSTEM,
31c93303 539 'archetypes' => array(
03d9401e
MD
540 'manager' => CAP_ALLOW
541 )
542 ),
543
544 // can the user manage another user's profile page?
545 'moodle/user:manageblocks' => array(
546
547 'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
548
549 'captype' => 'write',
550 'contextlevel' => CONTEXT_USER
551 ),
552
553 // can the user manage their own profile page?
554 'moodle/user:manageownblocks' => array(
555
556 'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
557
558 'captype' => 'write',
559 'contextlevel' => CONTEXT_SYSTEM,
31c93303 560 'archetypes' => array(
e4f413b4
MD
561 'user' => CAP_ALLOW
562 )
563 ),
564
565 // can the user manage their own files?
566 'moodle/user:manageownfiles' => array(
567
568 'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
569
570 'captype' => 'write',
571 'contextlevel' => CONTEXT_SYSTEM,
572 'archetypes' => array(
573 'user' => CAP_ALLOW
03d9401e
MD
574 )
575 ),
576
380c122f
FM
577 // Can the user ignore the setting userquota?
578 // The permissions are cloned from ignorefilesizelimits as it was partly used for that purpose.
579 'moodle/user:ignoreuserquota' => array(
580 'riskbitmap' => RISK_SPAM,
581 'captype' => 'write',
582 'contextlevel' => CONTEXT_SYSTEM,
583 'clonepermissionsfrom' => 'moodle/course:ignorefilesizelimits'
584 ),
585
03d9401e
MD
586 // can the user manage the system default dashboard page?
587 'moodle/my:configsyspages' => array(
588
589 'riskbitmap' => RISK_SPAM | RISK_PERSONAL | RISK_CONFIG,
590
591 'captype' => 'write',
592 'contextlevel' => CONTEXT_SYSTEM,
31c93303 593 'archetypes' => array(
03d9401e
MD
594 'manager' => CAP_ALLOW
595 )
596 ),
597
bbbf2d40 598 'moodle/role:assign' => array(
eef868d1 599
3a0c6cca 600 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
601
bbbf2d40 602 'captype' => 'write',
f432bebf 603 'contextlevel' => CONTEXT_COURSE,
31c93303 604 'archetypes' => array(
861fdcaa 605 'editingteacher' => CAP_ALLOW,
4f0c2d00 606 'manager' => CAP_ALLOW
68c52526 607 )
608 ),
eef868d1 609
01a2ce80
PS
610 'moodle/role:review' => array(
611
612 'riskbitmask' => RISK_PERSONAL,
613
614 'captype' => 'read',
615 'contextlevel' => CONTEXT_COURSE,
31c93303 616 'archetypes' => array(
01a2ce80
PS
617 'teacher' => CAP_ALLOW,
618 'editingteacher' => CAP_ALLOW,
4f0c2d00 619 'manager' => CAP_ALLOW
01a2ce80
PS
620 )
621 ),
622
68c52526 623 'moodle/role:override' => array(
eef868d1 624
bcdb0f19 625 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
626
68c52526 627 'captype' => 'write',
f432bebf 628 'contextlevel' => CONTEXT_COURSE,
31c93303 629 'archetypes' => array(
4f0c2d00 630 'manager' => CAP_ALLOW
bbbf2d40 631 )
632 ),
eef868d1 633
3a0c6cca 634 'moodle/role:safeoverride' => array(
635
636 'riskbitmask' => RISK_SPAM,
637
638 'captype' => 'write',
f432bebf 639 'contextlevel' => CONTEXT_COURSE,
31c93303 640 'archetypes' => array(
3a0c6cca 641 'editingteacher' => CAP_ALLOW
642 )
643 ),
644
bbbf2d40 645 'moodle/role:manage' => array(
eef868d1 646
bcdb0f19 647 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
648
bbbf2d40 649 'captype' => 'write',
650 'contextlevel' => CONTEXT_SYSTEM,
31c93303 651 'archetypes' => array(
4f0c2d00 652 'manager' => CAP_ALLOW
bbbf2d40 653 )
654 ),
f43ce1ad 655
20dd4cf5 656 'moodle/role:switchroles' => array(
bcdb0f19 657
3a0c6cca 658 'riskbitmask' => RISK_XSS | RISK_PERSONAL,
bcdb0f19 659
20dd4cf5 660 'captype' => 'read',
f432bebf 661 'contextlevel' => CONTEXT_COURSE,
31c93303 662 'archetypes' => array(
20dd4cf5 663 'editingteacher' => CAP_ALLOW,
4f0c2d00 664 'manager' => CAP_ALLOW
20dd4cf5 665 )
666 ),
667
8ed5dd63 668 // Create, update and delete course categories. (Deleting a course category
669 // does not let you delete the courses it contains, unless you also have
670 // moodle/course: delete.) Creating and deleting requires this permission in
671 // the parent category.
672 'moodle/category:manage' => array(
eef868d1 673
89a792ab 674 'riskbitmask' => RISK_XSS,
675
bbbf2d40 676 'captype' => 'write',
677 'contextlevel' => CONTEXT_COURSECAT,
31c93303 678 'archetypes' => array(
4f0c2d00 679 'manager' => CAP_ALLOW
8ed5dd63 680 ),
681 'clonepermissionsfrom' => 'moodle/category:update'
bbbf2d40 682 ),
eef868d1 683
8ed5dd63 684 'moodle/category:viewhiddencategories' => array(
eef868d1 685
8ed5dd63 686 'captype' => 'read',
bbbf2d40 687 'contextlevel' => CONTEXT_COURSECAT,
31c93303 688 'archetypes' => array(
8ed5dd63 689 'coursecreator' => CAP_ALLOW,
4f0c2d00 690 'manager' => CAP_ALLOW
8ed5dd63 691 ),
692 'clonepermissionsfrom' => 'moodle/category:visibility'
bbbf2d40 693 ),
eef868d1 694
3f791403
PS
695 // create, delete, move cohorts in system and course categories,
696 // (cohorts with component !== null can be only moved)
697 'moodle/cohort:manage' => array(
698
699 'captype' => 'write',
700 'contextlevel' => CONTEXT_COURSECAT,
31c93303 701 'archetypes' => array(
3f791403
PS
702 'manager' => CAP_ALLOW
703 )
704 ),
705
706 // add and remove cohort members (only for cohorts where component !== null)
707 'moodle/cohort:assign' => array(
708
709 'captype' => 'write',
710 'contextlevel' => CONTEXT_COURSECAT,
31c93303 711 'archetypes' => array(
3f791403
PS
712 'manager' => CAP_ALLOW
713 )
714 ),
715
716 // view members of a cohort, this can be used in course context too,
717 // this also controls the ability to actually use cohort
718 'moodle/cohort:view' => array(
719
720 'captype' => 'read',
721 'contextlevel' => CONTEXT_COURSE,
31c93303 722 'archetypes' => array(
3f791403
PS
723 'editingteacher' => CAP_ALLOW,
724 'manager' => CAP_ALLOW
725 )
726 ),
727
bbbf2d40 728 'moodle/course:create' => array(
eef868d1 729
21b6db6e 730 'riskbitmask' => RISK_XSS,
731
bbbf2d40 732 'captype' => 'write',
5e992f56 733 'contextlevel' => CONTEXT_COURSECAT,
31c93303 734 'archetypes' => array(
4473252d 735 'coursecreator' => CAP_ALLOW,
4f0c2d00 736 'manager' => CAP_ALLOW
bbbf2d40 737 )
738 ),
eef868d1 739
e452210a 740 'moodle/course:request' => array(
741 'captype' => 'write',
742 'contextlevel' => CONTEXT_SYSTEM,
31c93303 743 'archetypes' => array(
e452210a 744 'user' => CAP_ALLOW,
745 )
746 ),
747
bbbf2d40 748 'moodle/course:delete' => array(
eef868d1 749
3a0c6cca 750 'riskbitmask' => RISK_DATALOSS,
751
bbbf2d40 752 'captype' => 'write',
753 'contextlevel' => CONTEXT_COURSE,
31c93303 754 'archetypes' => array(
4f0c2d00 755 'manager' => CAP_ALLOW
bbbf2d40 756 )
757 ),
eef868d1 758
bbbf2d40 759 'moodle/course:update' => array(
eef868d1 760
21b6db6e 761 'riskbitmask' => RISK_XSS,
762
bbbf2d40 763 'captype' => 'write',
764 'contextlevel' => CONTEXT_COURSE,
31c93303 765 'archetypes' => array(
bbbf2d40 766 'editingteacher' => CAP_ALLOW,
4f0c2d00 767 'manager' => CAP_ALLOW
bbbf2d40 768 )
769 ),
eef868d1 770
df997f84 771 'moodle/course:view' => array(
eef868d1 772
bbbf2d40 773 'captype' => 'read',
774 'contextlevel' => CONTEXT_COURSE,
31c93303 775 'archetypes' => array(
df997f84 776 'manager' => CAP_ALLOW,
bbbf2d40 777 )
778 ),
eef868d1 779
df997f84
PS
780 /* review course enrolments - no group restrictions, it is really full access to all participants info*/
781 'moodle/course:enrolreview' => array(
782
783 'riskbitmask' => RISK_PERSONAL,
4f0c2d00
PS
784
785 'captype' => 'read',
786 'contextlevel' => CONTEXT_COURSE,
31c93303 787 'archetypes' => array(
df997f84
PS
788 'editingteacher' => CAP_ALLOW,
789 'manager' => CAP_ALLOW,
790 )
791 ),
792
793 /* add, remove, hide enrol instances in courses */
794 'moodle/course:enrolconfig' => array(
795
796 'riskbitmask' => RISK_PERSONAL,
797
798 'captype' => 'write',
799 'contextlevel' => CONTEXT_COURSE,
800 'archetypes' => array(
801 'editingteacher' => CAP_ALLOW,
4f0c2d00
PS
802 'manager' => CAP_ALLOW,
803 )
804 ),
805
77c645df 806 'moodle/course:bulkmessaging' => array(
807
808 'riskbitmask' => RISK_SPAM,
809
810 'captype' => 'write',
811 'contextlevel' => CONTEXT_COURSE,
31c93303 812 'archetypes' => array(
77c645df 813 'teacher' => CAP_ALLOW,
814 'editingteacher' => CAP_ALLOW,
4f0c2d00 815 'manager' => CAP_ALLOW
77c645df 816 )
817 ),
818
1c45e42e 819 'moodle/course:viewhiddenuserfields' => array(
eef868d1 820
21b6db6e 821 'riskbitmask' => RISK_PERSONAL,
4e781c7b 822
823 'captype' => 'read',
824 'contextlevel' => CONTEXT_COURSE,
31c93303 825 'archetypes' => array(
4e781c7b 826 'teacher' => CAP_ALLOW,
827 'editingteacher' => CAP_ALLOW,
4f0c2d00 828 'manager' => CAP_ALLOW
4e781c7b 829 )
830 ),
831
1c45e42e 832 'moodle/course:viewhiddencourses' => array(
eef868d1 833
1c45e42e 834 'captype' => 'read',
835 'contextlevel' => CONTEXT_COURSE,
31c93303 836 'archetypes' => array(
2f5ab42b 837 'coursecreator' => CAP_ALLOW,
838 'teacher' => CAP_ALLOW,
839 'editingteacher' => CAP_ALLOW,
4f0c2d00 840 'manager' => CAP_ALLOW
1c45e42e 841 )
842 ),
eef868d1 843
bbbf2d40 844 'moodle/course:visibility' => array(
eef868d1 845
bbbf2d40 846 'captype' => 'write',
847 'contextlevel' => CONTEXT_COURSE,
31c93303 848 'archetypes' => array(
df997f84 849 'editingteacher' => CAP_ALLOW,
4f0c2d00 850 'manager' => CAP_ALLOW
bbbf2d40 851 )
852 ),
eef868d1 853
a028c291 854 'moodle/course:managefiles' => array(
eef868d1 855
21b6db6e 856 'riskbitmask' => RISK_XSS,
857
a028c291 858 'captype' => 'write',
859 'contextlevel' => CONTEXT_COURSE,
31c93303 860 'archetypes' => array(
a028c291 861 'editingteacher' => CAP_ALLOW,
4f0c2d00 862 'manager' => CAP_ALLOW
a028c291 863 )
864 ),
eef868d1 865
8ac95c27
AD
866 'moodle/course:ignorefilesizelimits' => array(
867
868 'captype' => 'write',
869 'contextlevel' => CONTEXT_COURSE,
870 'archetypes' => array(
871 )
872 ),
873
bbbf2d40 874 'moodle/course:manageactivities' => array(
eef868d1 875
21b6db6e 876 'riskbitmask' => RISK_XSS,
877
bbbf2d40 878 'captype' => 'write',
af189935 879 'contextlevel' => CONTEXT_MODULE,
31c93303 880 'archetypes' => array(
bbbf2d40 881 'editingteacher' => CAP_ALLOW,
4f0c2d00 882 'manager' => CAP_ALLOW
bbbf2d40 883 )
884 ),
eef868d1 885
bbbf2d40 886 'moodle/course:activityvisibility' => array(
eef868d1 887
bbbf2d40 888 'captype' => 'write',
af189935 889 'contextlevel' => CONTEXT_MODULE,
31c93303 890 'archetypes' => array(
bbbf2d40 891 'editingteacher' => CAP_ALLOW,
4f0c2d00 892 'manager' => CAP_ALLOW
bbbf2d40 893 )
894 ),
eef868d1 895
bbbf2d40 896 'moodle/course:viewhiddenactivities' => array(
eef868d1 897
bbbf2d40 898 'captype' => 'write',
af189935 899 'contextlevel' => CONTEXT_MODULE,
31c93303 900 'archetypes' => array(
bbbf2d40 901 'teacher' => CAP_ALLOW,
902 'editingteacher' => CAP_ALLOW,
4f0c2d00 903 'manager' => CAP_ALLOW
bbbf2d40 904 )
905 ),
eef868d1 906
bbbf2d40 907 'moodle/course:viewparticipants' => array(
eef868d1 908
bbbf2d40 909 'captype' => 'read',
910 'contextlevel' => CONTEXT_COURSE,
31c93303 911 'archetypes' => array(
bbbf2d40 912 'student' => CAP_ALLOW,
913 'teacher' => CAP_ALLOW,
914 'editingteacher' => CAP_ALLOW,
4f0c2d00 915 'manager' => CAP_ALLOW
165088f6 916 )
917 ),
f7c0d84b 918
919 'moodle/course:changefullname' => array(
920
cd7f72c0 921 'riskbitmask' => RISK_XSS,
922
f7c0d84b 923 'captype' => 'write',
924 'contextlevel' => CONTEXT_COURSE,
31c93303 925 'archetypes' => array(
f7c0d84b 926 'editingteacher' => CAP_ALLOW,
4f0c2d00 927 'manager' => CAP_ALLOW
5e99b9d7 928 ),
929 'clonepermissionsfrom' => 'moodle/course:update'
f7c0d84b 930 ),
931
932 'moodle/course:changeshortname' => array(
933
cd7f72c0 934 'riskbitmask' => RISK_XSS,
935
f7c0d84b 936 'captype' => 'write',
937 'contextlevel' => CONTEXT_COURSE,
31c93303 938 'archetypes' => array(
f7c0d84b 939 'editingteacher' => CAP_ALLOW,
4f0c2d00 940 'manager' => CAP_ALLOW
5e99b9d7 941 ),
942 'clonepermissionsfrom' => 'moodle/course:update'
f7c0d84b 943 ),
944
945 'moodle/course:changeidnumber' => array(
946
cd7f72c0 947 'riskbitmask' => RISK_XSS,
948
f7c0d84b 949 'captype' => 'write',
950 'contextlevel' => CONTEXT_COURSE,
31c93303 951 'archetypes' => array(
f7c0d84b 952 'editingteacher' => CAP_ALLOW,
4f0c2d00 953 'manager' => CAP_ALLOW
5e99b9d7 954 ),
955 'clonepermissionsfrom' => 'moodle/course:update'
f7c0d84b 956 ),
50569ba3 957 'moodle/course:changecategory' => array(
958 'riskbitmask' => RISK_XSS,
959
960 'captype' => 'write',
961 'contextlevel' => CONTEXT_COURSE,
31c93303 962 'archetypes' => array(
50569ba3 963 'editingteacher' => CAP_ALLOW,
4f0c2d00 964 'manager' => CAP_ALLOW
50569ba3 965 ),
966 'clonepermissionsfrom' => 'moodle/course:update'
967 ),
968
969 'moodle/course:changesummary' => array(
970 'riskbitmask' => RISK_XSS,
971
972 'captype' => 'write',
973 'contextlevel' => CONTEXT_COURSE,
31c93303 974 'archetypes' => array(
50569ba3 975 'editingteacher' => CAP_ALLOW,
4f0c2d00 976 'manager' => CAP_ALLOW
50569ba3 977 ),
978 'clonepermissionsfrom' => 'moodle/course:update'
979 ),
980
f7c0d84b 981
165088f6 982 'moodle/site:viewparticipants' => array(
983
984 'captype' => 'read',
985 'contextlevel' => CONTEXT_SYSTEM,
31c93303 986 'archetypes' => array(
4f0c2d00 987 'manager' => CAP_ALLOW
bbbf2d40 988 )
989 ),
eef868d1 990
b61924d4 991 'moodle/course:isincompletionreports' => array(
992 'captype' => 'read',
993 'contextlevel' => CONTEXT_COURSE,
994 'archetypes' => array(
995 'student' => CAP_ALLOW,
996 ),
997 ),
998
bbbf2d40 999 'moodle/course:viewscales' => array(
eef868d1 1000
bbbf2d40 1001 'captype' => 'read',
1002 'contextlevel' => CONTEXT_COURSE,
31c93303 1003 'archetypes' => array(
bbbf2d40 1004 'student' => CAP_ALLOW,
1005 'teacher' => CAP_ALLOW,
1006 'editingteacher' => CAP_ALLOW,
4f0c2d00 1007 'manager' => CAP_ALLOW
bbbf2d40 1008 )
1009 ),
eef868d1 1010
bbbf2d40 1011 'moodle/course:managescales' => array(
eef868d1 1012
bbbf2d40 1013 'captype' => 'write',
1014 'contextlevel' => CONTEXT_COURSE,
31c93303 1015 'archetypes' => array(
bbbf2d40 1016 'editingteacher' => CAP_ALLOW,
4f0c2d00 1017 'manager' => CAP_ALLOW
bbbf2d40 1018 )
1019 ),
eef868d1 1020
bbbf2d40 1021 'moodle/course:managegroups' => array(
1022
1023 'captype' => 'write',
1024 'contextlevel' => CONTEXT_COURSE,
31c93303 1025 'archetypes' => array(
a028c291 1026 'editingteacher' => CAP_ALLOW,
4f0c2d00 1027 'manager' => CAP_ALLOW
a028c291 1028 )
1029 ),
eef868d1 1030
a028c291 1031 'moodle/course:reset' => array(
1032
3a0c6cca 1033 'riskbitmask' => RISK_DATALOSS,
1034
a028c291 1035 'captype' => 'write',
1036 'contextlevel' => CONTEXT_COURSE,
31c93303 1037 'archetypes' => array(
bbbf2d40 1038 'editingteacher' => CAP_ALLOW,
4f0c2d00 1039 'manager' => CAP_ALLOW
bbbf2d40 1040 )
1041 ),
eef868d1 1042
38c1dd19
RT
1043 'moodle/course:viewsuspendedusers' => array(
1044
1045 'captype' => 'read',
1046 'contextlevel' => CONTEXT_SYSTEM,
1047 'archetypes' => array(
1048 'editingteacher' => CAP_ALLOW,
1049 'manager' => CAP_ALLOW
1050 )
1051 ),
1052
bbbf2d40 1053 'moodle/blog:view' => array(
1054
1055 'captype' => 'read',
05de723b 1056 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1057 'archetypes' => array(
05de723b
NC
1058 'guest' => CAP_ALLOW,
1059 'user' => CAP_ALLOW,
1060 'student' => CAP_ALLOW,
1061 'teacher' => CAP_ALLOW,
1062 'editingteacher' => CAP_ALLOW,
4f0c2d00 1063 'manager' => CAP_ALLOW
05de723b
NC
1064 )
1065 ),
1066
1067 'moodle/blog:search' => array(
1068 'captype' => 'read',
1069 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1070 'archetypes' => array(
00adf177 1071 'guest' => CAP_ALLOW,
c785d40a 1072 'user' => CAP_ALLOW,
bbbf2d40 1073 'student' => CAP_ALLOW,
1074 'teacher' => CAP_ALLOW,
1075 'editingteacher' => CAP_ALLOW,
4f0c2d00 1076 'manager' => CAP_ALLOW
bbbf2d40 1077 )
1078 ),
eef868d1 1079
05de723b
NC
1080 'moodle/blog:viewdrafts' => array(
1081
1082 'riskbitmask' => RISK_PERSONAL,
1083 'captype' => 'read',
1084 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1085 'archetypes' => array(
4f0c2d00 1086 'manager' => CAP_ALLOW
05de723b
NC
1087 )
1088 ),
1089
5a8ab2e9 1090 'moodle/blog:create' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 1091
21b6db6e 1092 'riskbitmask' => RISK_SPAM,
1093
bbbf2d40 1094 'captype' => 'write',
1095 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1096 'archetypes' => array(
c785d40a 1097 'user' => CAP_ALLOW,
4f0c2d00 1098 'manager' => CAP_ALLOW
bbbf2d40 1099 )
1100 ),
eef868d1 1101
bbbf2d40 1102 'moodle/blog:manageentries' => array(
1103
21b6db6e 1104 'riskbitmask' => RISK_SPAM,
1105
bbbf2d40 1106 'captype' => 'write',
05de723b 1107 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1108 'archetypes' => array(
bbbf2d40 1109 'teacher' => CAP_ALLOW,
1110 'editingteacher' => CAP_ALLOW,
4f0c2d00 1111 'manager' => CAP_ALLOW
bbbf2d40 1112 )
1113 ),
05de723b 1114
cae83708 1115 'moodle/blog:manageexternal' => array(
1116
1117 'riskbitmask' => RISK_SPAM,
1118
1119 'captype' => 'write',
296f6c99 1120 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1121 'archetypes' => array(
cae83708 1122 'student' => CAP_ALLOW,
1123 'user' => CAP_ALLOW,
1124 'teacher' => CAP_ALLOW,
1125 'editingteacher' => CAP_ALLOW,
4f0c2d00 1126 'manager' => CAP_ALLOW
cae83708 1127 )
1128 ),
1129
05de723b
NC
1130 'moodle/blog:associatecourse' => array(
1131
1132 'captype' => 'write',
1133 'contextlevel' => CONTEXT_COURSE,
31c93303 1134 'archetypes' => array(
05de723b
NC
1135 'student' => CAP_ALLOW,
1136 'user' => CAP_ALLOW,
1137 'teacher' => CAP_ALLOW,
1138 'editingteacher' => CAP_ALLOW,
4f0c2d00 1139 'manager' => CAP_ALLOW
05de723b
NC
1140 )
1141 ),
1142
1143 'moodle/blog:associatemodule' => array(
1144
1145 'captype' => 'write',
1146 'contextlevel' => CONTEXT_MODULE,
31c93303 1147 'archetypes' => array(
05de723b
NC
1148 'student' => CAP_ALLOW,
1149 'user' => CAP_ALLOW,
1150 'teacher' => CAP_ALLOW,
1151 'editingteacher' => CAP_ALLOW,
4f0c2d00 1152 'manager' => CAP_ALLOW
05de723b
NC
1153 )
1154 ),
eef868d1 1155
5a8ab2e9 1156 'moodle/calendar:manageownentries' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 1157
21b6db6e 1158 'riskbitmask' => RISK_SPAM,
1159
bbbf2d40 1160 'captype' => 'write',
f432bebf 1161 'contextlevel' => CONTEXT_COURSE,
31c93303 1162 'archetypes' => array(
c785d40a 1163 'user' => CAP_ALLOW,
4f0c2d00 1164 'manager' => CAP_ALLOW
bbbf2d40 1165 )
1166 ),
eef868d1 1167
f63d2922 1168 'moodle/calendar:managegroupentries' => array(
1169
1170 'riskbitmask' => RISK_SPAM,
1171
1172 'captype' => 'write',
f432bebf 1173 'contextlevel' => CONTEXT_COURSE,
31c93303 1174 'archetypes' => array(
f63d2922 1175 'teacher' => CAP_ALLOW,
1176 'editingteacher' => CAP_ALLOW,
4f0c2d00 1177 'manager' => CAP_ALLOW
f63d2922 1178 )
1179 ),
1180
bbbf2d40 1181 'moodle/calendar:manageentries' => array(
1182
21b6db6e 1183 'riskbitmask' => RISK_SPAM,
1184
bbbf2d40 1185 'captype' => 'write',
f432bebf 1186 'contextlevel' => CONTEXT_COURSE,
31c93303 1187 'archetypes' => array(
bbbf2d40 1188 'teacher' => CAP_ALLOW,
1189 'editingteacher' => CAP_ALLOW,
4f0c2d00 1190 'manager' => CAP_ALLOW
bbbf2d40 1191 )
77d4953e 1192 ),
a044c05d 1193
1194 'moodle/user:editprofile' => array(
1195
3a0c6cca 1196 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
a044c05d 1197
1198 'captype' => 'write',
1199 'contextlevel' => CONTEXT_USER,
31c93303 1200 'archetypes' => array(
4f0c2d00 1201 'manager' => CAP_ALLOW
a044c05d 1202 )
1203 ),
eef868d1 1204
a5b8be62 1205 'moodle/user:editownprofile' => array(
1cb3da36 1206
3a0c6cca 1207 'riskbitmask' => RISK_SPAM,
1208
a5b8be62 1209 'captype' => 'write',
1210 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1211 'archetypes' => array(
1cb3da36 1212 'guest' => CAP_PROHIBIT,
1213 'user' => CAP_ALLOW,
4f0c2d00 1214 'manager' => CAP_ALLOW
a5b8be62 1215 )
1cb3da36 1216 ),
1217
a5b8be62 1218 'moodle/user:changeownpassword' => array(
1cb3da36 1219
a5b8be62 1220 'captype' => 'write',
1221 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1222 'archetypes' => array(
1cb3da36 1223 'guest' => CAP_PROHIBIT,
1224 'user' => CAP_ALLOW,
4f0c2d00 1225 'manager' => CAP_ALLOW
a5b8be62 1226 )
1cb3da36 1227 ),
1228
eef868d1 1229 // The next 3 might make no sense for some roles, e.g teacher, etc.
77d4953e 1230 // since the next level up is site. These are more for the parent role
1231 'moodle/user:readuserposts' => array(
bcdb0f19 1232
77d4953e 1233 'captype' => 'read',
4b10f08b 1234 'contextlevel' => CONTEXT_USER,
31c93303 1235 'archetypes' => array(
77d4953e 1236 'student' => CAP_ALLOW,
1237 'teacher' => CAP_ALLOW,
1238 'editingteacher' => CAP_ALLOW,
4f0c2d00 1239 'manager' => CAP_ALLOW
77d4953e 1240 )
1241 ),
eef868d1 1242
77d4953e 1243 'moodle/user:readuserblogs' => array(
bcdb0f19 1244
77d4953e 1245 'captype' => 'read',
4b10f08b 1246 'contextlevel' => CONTEXT_USER,
31c93303 1247 'archetypes' => array(
77d4953e 1248 'student' => CAP_ALLOW,
1249 'teacher' => CAP_ALLOW,
1250 'editingteacher' => CAP_ALLOW,
4f0c2d00 1251 'manager' => CAP_ALLOW
77d4953e 1252 )
1253 ),
eef868d1 1254
3c7da16d 1255 // designed for parent role - not used in legacy roles
77d4953e 1256 'moodle/user:viewuseractivitiesreport' => array(
3c7da16d 1257 'riskbitmask' => RISK_PERSONAL,
bcdb0f19 1258
77d4953e 1259 'captype' => 'read',
4b10f08b 1260 'contextlevel' => CONTEXT_USER,
31c93303 1261 'archetypes' => array(
77d4953e 1262 )
945f88ca 1263 ),
4e781c7b 1264
3b120e46 1265 //capabilities designed for the new message system configuration
1266 'moodle/user:editmessageprofile' => array(
f7c0d84b 1267
3b120e46 1268 'riskbitmask' => RISK_SPAM,
f7c0d84b 1269
3b120e46 1270 'captype' => 'write',
1271 'contextlevel' => CONTEXT_USER,
31c93303 1272 'archetypes' => array(
4f0c2d00 1273 'manager' => CAP_ALLOW
3b120e46 1274 )
1275 ),
f7c0d84b 1276
1277 'moodle/user:editownmessageprofile' => array(
1278
1279 'captype' => 'write',
1280 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1281 'archetypes' => array(
3b120e46 1282 'guest' => CAP_PROHIBIT,
1283 'user' => CAP_ALLOW,
4f0c2d00 1284 'manager' => CAP_ALLOW
f7c0d84b 1285 )
3b120e46 1286 ),
eef868d1 1287
271e6dec 1288 'moodle/question:managecategory' => array(
14d701d6 1289 'riskbitmask' => RISK_SPAM | RISK_XSS,
945f88ca 1290 'captype' => 'write',
1291 'contextlevel' => CONTEXT_COURSE,
31c93303 1292 'archetypes' => array(
945f88ca 1293 'editingteacher' => CAP_ALLOW,
4f0c2d00 1294 'manager' => CAP_ALLOW
945f88ca 1295 )
a5b8be62 1296 ),
1297
271e6dec 1298 //new in moodle 1.9
1299 'moodle/question:add' => array(
14d701d6 1300 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1301 'captype' => 'write',
1302 'contextlevel' => CONTEXT_COURSE,
31c93303 1303 'archetypes' => array(
271e6dec 1304 'editingteacher' => CAP_ALLOW,
4f0c2d00 1305 'manager' => CAP_ALLOW
271e6dec 1306 ),
1307 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1308 ),
271e6dec 1309 'moodle/question:editmine' => array(
14d701d6 1310 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1311 'captype' => 'write',
1312 'contextlevel' => CONTEXT_COURSE,
31c93303 1313 'archetypes' => array(
271e6dec 1314 'editingteacher' => CAP_ALLOW,
4f0c2d00 1315 'manager' => CAP_ALLOW
271e6dec 1316 ),
a5b8be62 1317 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1318 ),
1319 'moodle/question:editall' => array(
14d701d6 1320 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1321 'captype' => 'write',
1322 'contextlevel' => CONTEXT_COURSE,
31c93303 1323 'archetypes' => array(
271e6dec 1324 'editingteacher' => CAP_ALLOW,
4f0c2d00 1325 'manager' => CAP_ALLOW
271e6dec 1326 ),
a5b8be62 1327 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1328 ),
1329 'moodle/question:viewmine' => array(
945f88ca 1330 'captype' => 'read',
1331 'contextlevel' => CONTEXT_COURSE,
31c93303 1332 'archetypes' => array(
945f88ca 1333 'editingteacher' => CAP_ALLOW,
4f0c2d00 1334 'manager' => CAP_ALLOW
271e6dec 1335 ),
a5b8be62 1336 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1337 ),
271e6dec 1338 'moodle/question:viewall' => array(
1339 'captype' => 'read',
1340 'contextlevel' => CONTEXT_COURSE,
31c93303 1341 'archetypes' => array(
271e6dec 1342 'editingteacher' => CAP_ALLOW,
4f0c2d00 1343 'manager' => CAP_ALLOW
271e6dec 1344 ),
a5b8be62 1345 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1346 ),
1347 'moodle/question:usemine' => 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:useall' => 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'
1364 ),
271e6dec 1365 'moodle/question:movemine' => array(
945f88ca 1366 'captype' => 'write',
1367 'contextlevel' => CONTEXT_COURSE,
31c93303 1368 'archetypes' => array(
945f88ca 1369 'editingteacher' => CAP_ALLOW,
4f0c2d00 1370 'manager' => CAP_ALLOW
271e6dec 1371 ),
a5b8be62 1372 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1373 ),
271e6dec 1374 'moodle/question:moveall' => 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'
7191a1fa 1382 ),
271e6dec 1383 //END new in moodle 1.9
a5b8be62 1384
0eb6b04a 1385 // Configure the installed question types.
1386 'moodle/question:config' => array(
0eb6b04a 1387 'riskbitmask' => RISK_CONFIG,
0eb6b04a 1388 'captype' => 'write',
1389 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1390 'archetypes' => array(
4f0c2d00 1391 'manager' => CAP_ALLOW
0eb6b04a 1392 )
1393 ),
1394
62e76c67 1395 // While attempting questions, the ability to flag particular questions for later reference.
1396 'moodle/question:flag' => array(
1397 'captype' => 'write',
1398 'contextlevel' => CONTEXT_COURSE,
31c93303 1399 'archetypes' => array(
62e76c67 1400 'student' => CAP_ALLOW,
1401 'teacher' => CAP_ALLOW,
1402 'editingteacher' => CAP_ALLOW,
4f0c2d00 1403 'manager' => CAP_ALLOW
62e76c67 1404 )
1405 ),
bcdb0f19 1406
62e76c67 1407 'moodle/site:doclinks' => array(
7191a1fa 1408 'captype' => 'read',
1409 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1410 'archetypes' => array(
7191a1fa 1411 'teacher' => CAP_ALLOW,
1412 'editingteacher' => CAP_ALLOW,
4f0c2d00 1413 'manager' => CAP_ALLOW
7191a1fa 1414 )
3924b988 1415 ),
eef868d1 1416
3924b988 1417 'moodle/course:sectionvisibility' => array(
bcdb0f19 1418
3924b988 1419 'captype' => 'write',
1420 'contextlevel' => CONTEXT_COURSE,
31c93303 1421 'archetypes' => array(
3924b988 1422 'editingteacher' => CAP_ALLOW,
4f0c2d00 1423 'manager' => CAP_ALLOW
3924b988 1424 )
1425 ),
eef868d1 1426
dc558690 1427 'moodle/course:useremail' => array(
bcdb0f19 1428
dc558690 1429 'captype' => 'write',
1430 'contextlevel' => CONTEXT_COURSE,
31c93303 1431 'archetypes' => array(
dc558690 1432 'editingteacher' => CAP_ALLOW,
4f0c2d00 1433 'manager' => CAP_ALLOW
dc558690 1434 )
1435 ),
eef868d1 1436
3924b988 1437 'moodle/course:viewhiddensections' => array(
bcdb0f19 1438
3924b988 1439 'captype' => 'write',
1440 'contextlevel' => CONTEXT_COURSE,
31c93303 1441 'archetypes' => array(
3924b988 1442 'editingteacher' => CAP_ALLOW,
4f0c2d00 1443 'manager' => CAP_ALLOW
3924b988 1444 )
1445 ),
eef868d1 1446
3924b988 1447 'moodle/course:setcurrentsection' => array(
bcdb0f19 1448
3924b988 1449 'captype' => 'write',
1450 'contextlevel' => CONTEXT_COURSE,
31c93303 1451 'archetypes' => array(
3924b988 1452 'editingteacher' => CAP_ALLOW,
4f0c2d00 1453 'manager' => CAP_ALLOW
3924b988 1454 )
1455 ),
eef868d1 1456
ad778c84
FM
1457 'moodle/course:movesections' => array(
1458
1459 'captype' => 'write',
1460 'contextlevel' => CONTEXT_COURSE,
1461 'archetypes' => array(
1462 'editingteacher' => CAP_ALLOW,
1463 'manager' => CAP_ALLOW
1464 ),
1465 'clonepermissionsfrom' => 'moodle/course:update'
1466 ),
1467
dd45888a 1468 'moodle/site:mnetlogintoremote' => array(
bc4c9800 1469
3924b988 1470 'captype' => 'read',
dd45888a 1471 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1472 'archetypes' => array(
3924b988 1473 )
1474 ),
eef868d1 1475
dd45888a 1476 'moodle/grade:viewall' => array(
bcdb0f19 1477 'riskbitmask' => RISK_PERSONAL,
dd45888a 1478 'captype' => 'read',
eecf76df 1479 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_USER
31c93303 1480 'archetypes' => array(
dd45888a 1481 'teacher' => CAP_ALLOW,
3924b988 1482 'editingteacher' => CAP_ALLOW,
4f0c2d00 1483 'manager' => CAP_ALLOW
dd45888a 1484 ),
1485 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
f509ce06 1486 ),
f43ce1ad 1487
dd45888a 1488 'moodle/grade:view' => array(
f509ce06 1489 'captype' => 'read',
eecf76df 1490 'contextlevel' => CONTEXT_COURSE,
31c93303 1491 'archetypes' => array(
dd45888a 1492 'student' => CAP_ALLOW
f509ce06 1493 )
ca9ffa18 1494 ),
dd45888a 1495
1496 'moodle/grade:viewhidden' => array(
ca9ffa18 1497 'riskbitmask' => RISK_PERSONAL,
1498 'captype' => 'read',
eecf76df 1499 'contextlevel' => CONTEXT_COURSE,
31c93303 1500 'archetypes' => array(
0371f8e5 1501 'teacher' => CAP_ALLOW,
1502 'editingteacher' => CAP_ALLOW,
4f0c2d00 1503 'manager' => CAP_ALLOW
dd45888a 1504 ),
1505 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
ca9ffa18 1506 ),
dd45888a 1507
1508 'moodle/grade:import' => array(
3a0c6cca 1509 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
dd45888a 1510 'captype' => 'write',
ca9ffa18 1511 'contextlevel' => CONTEXT_COURSE,
31c93303 1512 'archetypes' => array(
ca9ffa18 1513 'editingteacher' => CAP_ALLOW,
4f0c2d00 1514 'manager' => CAP_ALLOW
dd45888a 1515 ),
1516 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1517 ),
dd45888a 1518
1519 'moodle/grade:export' => array(
ca9ffa18 1520 'riskbitmask' => RISK_PERSONAL,
1521 'captype' => 'read',
1522 'contextlevel' => CONTEXT_COURSE,
31c93303 1523 'archetypes' => array(
ca9ffa18 1524 'teacher' => CAP_ALLOW,
1525 'editingteacher' => CAP_ALLOW,
4f0c2d00 1526 'manager' => CAP_ALLOW
dd45888a 1527 ),
1528 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1529 ),
dd45888a 1530
1531 'moodle/grade:manage' => array(
3a0c6cca 1532 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
dd45888a 1533 'captype' => 'write',
1534 'contextlevel' => CONTEXT_COURSE,
31c93303 1535 'archetypes' => array(
dd45888a 1536 'editingteacher' => CAP_ALLOW,
4f0c2d00 1537 'manager' => CAP_ALLOW
dd45888a 1538 ),
1539 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1540 ),
dd45888a 1541
a5b8be62 1542 'moodle/grade:edit' => array(
1543 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
04259694 1544 'captype' => 'write',
1545 'contextlevel' => CONTEXT_COURSE,
31c93303 1546 'archetypes' => array(
04259694 1547 'editingteacher' => CAP_ALLOW,
4f0c2d00 1548 'manager' => CAP_ALLOW
04259694 1549 ),
1550 'clonepermissionsfrom' => 'moodle/course:managegrades'
1551 ),
1552
86e9ccfd
DM
1553 // ability to define advanced grading forms in activities either from scratch
1554 // or from a shared template
f25a5a32
DM
1555 'moodle/grade:managegradingforms' => array(
1556 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
1557 'captype' => 'write',
553af5fd 1558 'contextlevel' => CONTEXT_COURSE,
f25a5a32
DM
1559 'archetypes' => array(
1560 'editingteacher' => CAP_ALLOW,
1561 'manager' => CAP_ALLOW
1562 ),
1563 'clonepermissionsfrom' => 'moodle/course:managegrades'
04259694 1564 ),
1565
86e9ccfd
DM
1566 // ability to save a grading form as a new shared template and eventually edit
1567 // and remove own templates (templates originally shared by that user)
553af5fd 1568 'moodle/grade:sharegradingforms' => array(
86e9ccfd
DM
1569 'riskbitmask' => RISK_XSS,
1570 'captype' => 'write',
1571 'contextlevel' => CONTEXT_SYSTEM,
1572 'archetypes' => array(
1573 'manager' => CAP_ALLOW
1574 ),
1575 ),
1576
1577 // ability to edit and remove any shared template, even those originally shared
1578 // by other users
1579 'moodle/grade:managesharedforms' => array(
1580 'riskbitmask' => RISK_XSS,
553af5fd
DM
1581 'captype' => 'write',
1582 'contextlevel' => CONTEXT_SYSTEM,
1583 'archetypes' => array(
1584 'manager' => CAP_ALLOW
1585 ),
1586 ),
1587
a5b8be62 1588 'moodle/grade:manageoutcomes' => array(
284abb09 1589 'captype' => 'write',
1590 'contextlevel' => CONTEXT_COURSE,
31c93303 1591 'archetypes' => array(
284abb09 1592 'editingteacher' => CAP_ALLOW,
4f0c2d00 1593 'manager' => CAP_ALLOW
284abb09 1594 ),
1595 'clonepermissionsfrom' => 'moodle/course:managegrades'
1596 ),
1597
1598 'moodle/grade:manageletters' => array(
ca9ffa18 1599 'captype' => 'write',
1600 'contextlevel' => CONTEXT_COURSE,
31c93303 1601 'archetypes' => array(
ca9ffa18 1602 'editingteacher' => CAP_ALLOW,
4f0c2d00 1603 'manager' => CAP_ALLOW
a5b8be62 1604 ),
1605 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1606 ),
dd45888a 1607
a5b8be62 1608 'moodle/grade:hide' => array(
ca9ffa18 1609 'captype' => 'write',
1610 'contextlevel' => CONTEXT_COURSE,
31c93303 1611 'archetypes' => array(
ca9ffa18 1612 'editingteacher' => CAP_ALLOW,
4f0c2d00 1613 'manager' => CAP_ALLOW
ca9ffa18 1614 )
1615 ),
dd45888a 1616
a5b8be62 1617 'moodle/grade:lock' => array(
dd45888a 1618 'captype' => 'write',
ca9ffa18 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:unlock' => array(
ca9ffa18 1627 'captype' => 'write',
1628 'contextlevel' => CONTEXT_COURSE,
31c93303 1629 'archetypes' => array(
ca9ffa18 1630 'editingteacher' => CAP_ALLOW,
4f0c2d00 1631 'manager' => CAP_ALLOW
ca9ffa18 1632 )
282c1695 1633 ),
dd45888a 1634
1635 'moodle/my:manageblocks' => array(
282c1695 1636 'captype' => 'write',
1637 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1638 'archetypes' => array(
282c1695 1639 'user' => CAP_ALLOW
1640 )
eca3af25 1641 ),
dd45888a 1642
eca3af25 1643 'moodle/notes:view' => array(
1644 'captype' => 'read',
f432bebf 1645 'contextlevel' => CONTEXT_COURSE,
31c93303 1646 'archetypes' => array(
eca3af25 1647 'teacher' => CAP_ALLOW,
1648 'editingteacher' => CAP_ALLOW,
4f0c2d00 1649 'manager' => CAP_ALLOW
eca3af25 1650 )
1651 ),
1652
1653 'moodle/notes:manage' => array(
3a0c6cca 1654 'riskbitmask' => RISK_SPAM,
1655
eca3af25 1656 'captype' => 'write',
f432bebf 1657 'contextlevel' => CONTEXT_COURSE,
31c93303 1658 'archetypes' => array(
eca3af25 1659 'teacher' => CAP_ALLOW,
1660 'editingteacher' => CAP_ALLOW,
4f0c2d00 1661 'manager' => CAP_ALLOW
eca3af25 1662 )
dd45888a 1663 ),
79642064 1664
1665 'moodle/tag:manage' => array(
3a0c6cca 1666 'riskbitmask' => RISK_SPAM,
1667
79642064 1668 'captype' => 'write',
1669 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1670 'archetypes' => array(
79642064 1671 'teacher' => CAP_ALLOW,
1672 'editingteacher' => CAP_ALLOW,
4f0c2d00 1673 'manager' => CAP_ALLOW
79642064 1674 )
705789bd 1675 ),
1676
1677 'moodle/tag:create' => array(
3a0c6cca 1678 'riskbitmask' => RISK_SPAM,
1679
705789bd 1680 'captype' => 'write',
1681 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1682 'archetypes' => array(
4f0c2d00 1683 'manager' => CAP_ALLOW,
0f07c40e 1684 'user' => CAP_ALLOW
705789bd 1685 )
1686 ),
a5b8be62 1687
705789bd 1688 'moodle/tag:edit' => array(
3a0c6cca 1689 'riskbitmask' => RISK_SPAM,
1690
705789bd 1691 'captype' => 'write',
1692 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1693 'archetypes' => array(
4f0c2d00 1694 'manager' => CAP_ALLOW,
3e6e529f 1695 'user' => CAP_ALLOW
98b5789d 1696 )
1697 ),
a5b8be62 1698
7dd764b8
JG
1699 'moodle/tag:flag' => array(
1700 'riskbitmask' => RISK_SPAM,
1701
1702 'captype' => 'write',
1703 'contextlevel' => CONTEXT_SYSTEM,
1704 'archetypes' => array(
1705 'manager' => CAP_ALLOW,
1706 'user' => CAP_ALLOW
1707 )
1708 ),
1709
98b5789d 1710 'moodle/tag:editblocks' => array(
1711 'captype' => 'write',
1712 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1713 'archetypes' => array(
705789bd 1714 'teacher' => CAP_ALLOW,
1715 'editingteacher' => CAP_ALLOW,
4f0c2d00 1716 'manager' => CAP_ALLOW
705789bd 1717 )
7e874772 1718 ),
1719
1720 'moodle/block:view' => array(
1721 'captype' => 'read',
1722 'contextlevel' => CONTEXT_BLOCK,
31c93303 1723 'archetypes' => array(
7e874772 1724 'guest' => CAP_ALLOW,
25a7d980 1725 'user' => CAP_ALLOW,
1726 'student' => CAP_ALLOW,
1727 'teacher' => CAP_ALLOW,
1728 'editingteacher' => CAP_ALLOW,
7e874772 1729 )
8512f577 1730 ),
1731
d14edf06 1732 'moodle/block:edit' => array(
1733 'riskbitmask' => RISK_SPAM | RISK_XSS,
1734
1735 'captype' => 'write',
1736 'contextlevel' => CONTEXT_BLOCK,
31c93303 1737 'archetypes' => array(
d14edf06 1738 'editingteacher' => CAP_ALLOW,
586e7976 1739 'manager' => CAP_ALLOW
d14edf06 1740 )
1741 ),
1742
8512f577 1743 'moodle/portfolio:export' => array(
1744 'captype' => 'read',
1745 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1746 'archetypes' => array(
8512f577 1747 'user' => CAP_ALLOW,
1748 'student' => CAP_ALLOW,
1749 'teacher' => CAP_ALLOW,
1750 'editingteacher' => CAP_ALLOW,
8512f577 1751 )
1bcb7eb5 1752 ),
1753 'moodle/comment:view' => array(
1bcb7eb5 1754 'captype' => 'read',
ad0ae261 1755 'contextlevel' => CONTEXT_COURSE,
31c93303 1756 'archetypes' => array(
b3da2877
SH
1757 'frontpage' => CAP_ALLOW,
1758 'guest' => CAP_ALLOW,
1bcb7eb5 1759 'user' => CAP_ALLOW,
1760 'student' => CAP_ALLOW,
1761 'teacher' => CAP_ALLOW,
1762 'editingteacher' => CAP_ALLOW,
4f0c2d00 1763 'manager' => CAP_ALLOW
1bcb7eb5 1764 )
1765 ),
1766 'moodle/comment:post' => array(
1767
1768 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
1769 'captype' => 'write',
ad0ae261 1770 'contextlevel' => CONTEXT_COURSE,
31c93303 1771 'archetypes' => array(
1bcb7eb5 1772 'user' => CAP_ALLOW,
1773 'student' => CAP_ALLOW,
1774 'teacher' => CAP_ALLOW,
1775 'editingteacher' => CAP_ALLOW,
4f0c2d00 1776 'manager' => CAP_ALLOW
1bcb7eb5 1777 )
1778 ),
1779 'moodle/comment:delete' => array(
1780
1781 'riskbitmask' => RISK_DATALOSS,
1782 'captype' => 'write',
ad0ae261 1783 'contextlevel' => CONTEXT_COURSE,
31c93303 1784 'archetypes' => array(
1bcb7eb5 1785 'editingteacher' => CAP_ALLOW,
4f0c2d00 1786 'manager' => CAP_ALLOW
1bcb7eb5 1787 )
5eacbd4b 1788 ),
1789 'moodle/webservice:createtoken' => array(
1790
52dd27bf 1791 'riskbitmask' => RISK_CONFIG | RISK_DATALOSS | RISK_SPAM | RISK_PERSONAL | RISK_XSS,
5eacbd4b 1792 'captype' => 'write',
1793 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1794 'archetypes' => array(
4f0c2d00 1795 'manager' => CAP_ALLOW
5eacbd4b 1796 )
a09aeee4 1797 ),
13ea96c4
DC
1798 'moodle/webservice:createmobiletoken' => array(
1799
f2eac756 1800 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
13ea96c4
DC
1801 'captype' => 'write',
1802 'contextlevel' => CONTEXT_SYSTEM,
1803 'archetypes' => array(
1804 'user' => CAP_ALLOW
1805 )
1806 ),
19fae119 1807 'moodle/rating:view' => array(
ad0ae261 1808
a09aeee4 1809 'captype' => 'read',
ad0ae261 1810 'contextlevel' => CONTEXT_COURSE,
31c93303 1811 'archetypes' => array(
ad0ae261 1812 'user' => CAP_ALLOW,
e116a818
AD
1813 'student' => CAP_ALLOW,
1814 'teacher' => CAP_ALLOW,
1815 'editingteacher' => CAP_ALLOW,
4f0c2d00 1816 'manager' => CAP_ALLOW
a09aeee4
AD
1817 )
1818 ),
6595a568 1819 'moodle/rating:viewany' => array(
ad0ae261 1820
6595a568
MD
1821 'riskbitmask' => RISK_PERSONAL,
1822 'captype' => 'read',
ad0ae261 1823 'contextlevel' => CONTEXT_COURSE,
31c93303 1824 'archetypes' => array(
ad0ae261 1825 'user' => CAP_ALLOW,
6595a568
MD
1826 'student' => CAP_ALLOW,
1827 'teacher' => CAP_ALLOW,
1828 'editingteacher' => CAP_ALLOW,
1829 'manager' => CAP_ALLOW
1830 )
1831 ),
19fae119 1832 'moodle/rating:viewall' => array(
ad0ae261 1833
a09aeee4
AD
1834 'riskbitmask' => RISK_PERSONAL,
1835 'captype' => 'read',
ad0ae261 1836 'contextlevel' => CONTEXT_COURSE,
31c93303 1837 'archetypes' => array(
ad0ae261 1838 'user' => CAP_ALLOW,
6595a568 1839 'student' => CAP_ALLOW,
e116a818
AD
1840 'teacher' => CAP_ALLOW,
1841 'editingteacher' => CAP_ALLOW,
4f0c2d00 1842 'manager' => CAP_ALLOW
a09aeee4
AD
1843 )
1844 ),
19fae119 1845 'moodle/rating:rate' => array(
ad0ae261 1846
a09aeee4 1847 'captype' => 'write',
ad0ae261 1848 'contextlevel' => CONTEXT_COURSE,
31c93303 1849 'archetypes' => array(
ad0ae261 1850 'user' => CAP_ALLOW,
6595a568 1851 'student' => CAP_ALLOW,
e116a818
AD
1852 'teacher' => CAP_ALLOW,
1853 'editingteacher' => CAP_ALLOW,
4f0c2d00 1854 'manager' => CAP_ALLOW
a09aeee4 1855 )
07ab0c80 1856 ),
1857 'moodle/course:publish' => array(
1858
07ab0c80 1859 'captype' => 'write',
ad0ae261 1860 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
07ab0c80 1861 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1862 'archetypes' => array(
07ab0c80 1863 'manager' => CAP_ALLOW
1864 )
2be4d090
MD
1865 ),
1866 'moodle/course:markcomplete' => array(
1867 'captype' => 'write',
1868 'contextlevel' => CONTEXT_COURSE,
31c93303 1869 'archetypes' => array(
2be4d090
MD
1870 'teacher' => CAP_ALLOW,
1871 'editingteacher' => CAP_ALLOW,
2be4d090
MD
1872 'manager' => CAP_ALLOW
1873 )
755f96f8 1874 ),
1875 'moodle/community:add' => array(
1876 'captype' => 'write',
1877 'contextlevel' => CONTEXT_SYSTEM,
1878 'archetypes' => array(
1879 'manager' => CAP_ALLOW,
1880 'teacher' => CAP_ALLOW,
17957b8f 1881 'editingteacher' => CAP_ALLOW,
755f96f8 1882 )
1883 ),
1884 'moodle/community:download' => array(
1885 'captype' => 'write',
1886 'contextlevel' => CONTEXT_SYSTEM,
1887 'archetypes' => array(
1888 'manager' => CAP_ALLOW,
17957b8f 1889 'editingteacher' => CAP_ALLOW,
755f96f8 1890 )
27806552
YB
1891 ),
1892
1893 // Badges.
1894 'moodle/badges:manageglobalsettings' => array(
1895 'riskbitmask' => RISK_DATALOSS | RISK_CONFIG,
1896 'captype' => 'write',
1897 'contextlevel' => CONTEXT_SYSTEM,
1898 'archetypes' => array(
1899 'manager' => CAP_ALLOW,
1900 'student' => CAP_PREVENT
1901 )
1902 ),
1903
1904 // View available badges without earning them.
1905 'moodle/badges:viewbadges' => array(
1906 'captype' => 'read',
1907 'contextlevel' => CONTEXT_SYSTEM,
1908 'archetypes' => array(
1909 'manager' => CAP_ALLOW,
1910 'user' => CAP_ALLOW,
1911 'student' => CAP_ALLOW
1912 )
1913 ),
1914
1915 // Manage badges on own private badges page.
1916 'moodle/badges:manageownbadges' => array(
1917 'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
1918 'captype' => 'write',
1919 'contextlevel' => CONTEXT_SYSTEM,
1920 'archetypes' => array(
1921 'user' => CAP_ALLOW
1922 )
1923 ),
1924
1925 // View public badges in other users' profiles.
1926 'moodle/badges:viewotherbadges' => array(
1927 'riskbitmap' => RISK_PERSONAL,
1928 'captype' => 'read',
1929 'contextlevel' => CONTEXT_USER,
1930 'archetypes' => array(
1931 'user' => CAP_ALLOW
1932 )
1933 ),
1934
1935 // Earn badge.
1936 'moodle/badges:earnbadge' => array(
1937 'captype' => 'write',
1938 'contextlevel' => CONTEXT_SYSTEM,
1939 'archetypes' => array(
1940 'user' => CAP_ALLOW,
1941 'student' => CAP_ALLOW,
1942 )
1943 ),
1944
1945 // Create/duplicate badges.
1946 'moodle/badges:createbadge' => array(
1947 'riskbitmask' => RISK_CONFIG | RISK_SPAM,
1948 'captype' => 'write',
1949 'contextlevel' => CONTEXT_SYSTEM,
1950 'archetypes' => array(
1951 'manager' => CAP_ALLOW,
1952 'coursecreator' => CAP_ALLOW,
1953 'editingteacher' => CAP_ALLOW,
1954 'student' => CAP_PREVENT
1955 )
1956 ),
1957
1958 // Delete badges.
1959 'moodle/badges:deletebadge' => array(
1960 'riskbitmask' => RISK_CONFIG | RISK_DATALOSS,
1961 'captype' => 'write',
1962 'contextlevel' => CONTEXT_SYSTEM,
1963 'archetypes' => array(
1964 'manager' => CAP_ALLOW,
1965 'coursecreator' => CAP_ALLOW,
1966 'editingteacher' => CAP_ALLOW,
1967 'student' => CAP_PREVENT
1968 )
1969 ),
1970
1971 // Set up/edit badge details.
1972 'moodle/badges:configuredetails' => array(
1973 'riskbitmask' => RISK_CONFIG,
1974 'captype' => 'write',
1975 'contextlevel' => CONTEXT_SYSTEM,
1976 'archetypes' => array(
1977 'manager' => CAP_ALLOW,
1978 'coursecreator' => CAP_ALLOW,
1979 'editingteacher' => CAP_ALLOW,
1980 'student' => CAP_PREVENT
1981 )
1982 ),
1983
1984 // Set up/edit criteria of earning a badge.
1985 'moodle/badges:configurecriteria' => array(
1986 'riskbitmask' => RISK_CONFIG,
1987 'captype' => 'write',
1988 'contextlevel' => CONTEXT_SYSTEM,
1989 'archetypes' => array(
1990 'manager' => CAP_ALLOW,
1991 'coursecreator' => CAP_ALLOW,
1992 'editingteacher' => CAP_ALLOW,
1993 'student' => CAP_PREVENT
1994 )
1995 ),
1996
1997 // Configure badge messages.
1998 'moodle/badges:configuremessages' => array(
1999 'riskbitmask' => RISK_CONFIG,
2000 'captype' => 'write',
2001 'contextlevel' => CONTEXT_SYSTEM,
2002 'archetypes' => array(
2003 'manager' => CAP_ALLOW,
2004 'coursecreator' => CAP_ALLOW,
2005 'editingteacher' => CAP_ALLOW,
2006 'student' => CAP_PREVENT
2007 )
2008 ),
2009
2010 // Award badge to a user.
2011 'moodle/badges:awardbadge' => array(
2012 'riskbitmask' => RISK_SPAM,
2013 'captype' => 'write',
2014 'contextlevel' => CONTEXT_SYSTEM,
2015 'archetypes' => array(
2016 'manager' => CAP_ALLOW,
2017 'coursecreator' => CAP_ALLOW,
2018 'teacher' => CAP_ALLOW,
2019 'editingteacher' => CAP_ALLOW,
2020 'student' => CAP_PREVENT
2021 )
2022 ),
2023
2024 // View users who earned a specific badge without being able to award a badge.
2025 'moodle/badges:viewawarded' => array(
2026 'riskbitmask' => RISK_PERSONAL,
2027 'captype' => 'read',
2028 'contextlevel' => CONTEXT_SYSTEM,
2029 'archetypes' => array(
2030 'manager' => CAP_ALLOW,
2031 'teacher' => CAP_ALLOW,
2032 'editingteacher' => CAP_ALLOW,
2033 )
79642064 2034 )
bbbf2d40 2035);