rating MDL-23187 added rating caps to those listed within activity cap check pages
[moodle.git] / lib / db / access.php
CommitLineData
117bd748 1<?php
bbbf2d40 2//
3// Capability definitions for Moodle core.
4//
5// The capabilities are loaded into the database table when the module is
6// installed or updated. Whenever the capability definitions are updated,
7// the module version number should be bumped up.
8//
9// The system has four possible values for a capability:
10// CAP_ALLOW, CAP_PREVENT, CAP_PROHIBIT, and inherit (not set).
11//
12//
13// CAPABILITY NAMING CONVENTION
14//
15// It is important that capability names are unique. The naming convention
16// for capabilities that are specific to modules and blocks is as follows:
0ac940b3 17// [mod/block]/<plugin_name>:<capabilityname>
bbbf2d40 18//
19// component_name should be the same as the directory name of the mod or block.
20//
21// Core moodle capabilities are defined thus:
22// moodle/<capabilityclass>:<capabilityname>
23//
24// Examples: mod/forum:viewpost
25// block/recent_activity:view
26// moodle/site:deleteuser
27//
0ac940b3 28// The variable name for the capability definitions array is $capabilities
bbbf2d40 29
30
0ac940b3 31$capabilities = array(
bbbf2d40 32 'moodle/site:config' => array(
eef868d1 33
f432bebf 34 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG | RISK_DATALOSS,
21b6db6e 35
bbbf2d40 36 'captype' => 'write',
37 'contextlevel' => CONTEXT_SYSTEM,
31c93303 38 'archetypes' => array(
bbbf2d40 39 )
40 ),
eef868d1 41
51792df0 42 'moodle/site:readallmessages' => array(
eef868d1 43
bcdb0f19 44 'riskbitmask' => RISK_PERSONAL,
45
51792df0 46 'captype' => 'read',
47 'contextlevel' => CONTEXT_SYSTEM,
31c93303 48 'archetypes' => array(
4f0c2d00 49 'manager' => CAP_ALLOW,
4b7ae3c4 50 'editingteacher' => CAP_ALLOW
51792df0 51 )
52 ),
f7c0d84b 53
576ad290 54 'moodle/site:sendmessage' => array(
55
3a0c6cca 56 'riskbitmask' => RISK_SPAM,
576ad290 57
58 'captype' => 'write',
59 'contextlevel' => CONTEXT_SYSTEM,
31c93303 60 'archetypes' => array(
4f0c2d00 61 'manager' => CAP_ALLOW,
576ad290 62 'user' => CAP_ALLOW
63 )
f7c0d84b 64 ),
eef868d1 65
51792df0 66 'moodle/site:approvecourse' => array(
eef868d1 67
bcdb0f19 68 'riskbitmask' => RISK_XSS,
69
51792df0 70 'captype' => 'write',
71 'contextlevel' => CONTEXT_SYSTEM,
31c93303 72 'archetypes' => array(
4f0c2d00 73 'manager' => CAP_ALLOW
51792df0 74 )
75 ),
eef868d1 76
d2940003 77 'moodle/backup:backupcourse' => array(
eef868d1 78
21b6db6e 79 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
80
bbbf2d40 81 'captype' => 'write',
f432bebf 82 'contextlevel' => CONTEXT_COURSE,
31c93303 83 'archetypes' => array(
7246585a 84 'editingteacher' => CAP_ALLOW,
4f0c2d00 85 'manager' => CAP_ALLOW
d2940003
EL
86 ),
87
88 'clonepermissionsfrom' => 'moodle/site:backup'
bbbf2d40 89 ),
eef868d1 90
57ca97b3
EL
91 'moodle/backup:backupsection' => array(
92
93 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
94
95 'captype' => 'write',
96 'contextlevel' => CONTEXT_COURSE,
31c93303 97 'archetypes' => array(
57ca97b3
EL
98 'editingteacher' => CAP_ALLOW,
99 'manager' => CAP_ALLOW
100 ),
101
102 'clonepermissionsfrom' => 'moodle/backup:backupcourse'
103 ),
104
105 'moodle/backup:backupactivity' => array(
106
107 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
108
109 'captype' => 'write',
110 'contextlevel' => CONTEXT_MODULE,
31c93303 111 'archetypes' => array(
57ca97b3
EL
112 'editingteacher' => CAP_ALLOW,
113 'manager' => CAP_ALLOW
114 ),
115
116 'clonepermissionsfrom' => 'moodle/backup:backupcourse'
117 ),
118
119 'moodle/backup:backuptargethub' => array(
120
121 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
122
123 'captype' => 'write',
124 'contextlevel' => CONTEXT_COURSE,
31c93303 125 'archetypes' => array(
57ca97b3
EL
126 'editingteacher' => CAP_ALLOW,
127 'manager' => CAP_ALLOW
128 ),
129
130 'clonepermissionsfrom' => 'moodle/backup:backupcourse'
131 ),
132
133 'moodle/backup:backuptargetimport' => array(
134
135 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
136
137 'captype' => 'write',
138 'contextlevel' => CONTEXT_COURSE,
31c93303 139 'archetypes' => array(
57ca97b3
EL
140 'editingteacher' => CAP_ALLOW,
141 'manager' => CAP_ALLOW
142 ),
143
144 'clonepermissionsfrom' => 'moodle/backup:backupcourse'
145 ),
146
2fdde5d1 147 'moodle/backup:downloadfile' => array(
172dd12c 148
149 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
150
151 'captype' => 'write',
152 'contextlevel' => CONTEXT_COURSE,
31c93303 153 'archetypes' => array(
172dd12c 154 'editingteacher' => CAP_ALLOW,
4f0c2d00 155 'manager' => CAP_ALLOW
172dd12c 156 ),
157
2fdde5d1 158 'clonepermissionsfrom' => 'moodle/site:backupdownload'
172dd12c 159 ),
160
57ca97b3
EL
161 'moodle/backup:configure' => array(
162
163 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
164
165 'captype' => 'write',
166 'contextlevel' => CONTEXT_COURSE,
31c93303 167 'archetypes' => array(
57ca97b3
EL
168 'editingteacher' => CAP_ALLOW,
169 'manager' => CAP_ALLOW
170 )
171 ),
172
2fdde5d1 173 'moodle/backup:userinfo' => array(
172dd12c 174
2fdde5d1 175 'riskbitmask' => RISK_PERSONAL,
172dd12c 176
2fdde5d1 177 'captype' => 'read',
172dd12c 178 'contextlevel' => CONTEXT_COURSE,
31c93303 179 'archetypes' => array(
4f0c2d00 180 'manager' => CAP_ALLOW
2fdde5d1 181 )
172dd12c 182 ),
183
57ca97b3
EL
184 'moodle/backup:anonymise' => array(
185
186 'riskbitmask' => RISK_PERSONAL,
187
188 'captype' => 'read',
189 'contextlevel' => CONTEXT_COURSE,
31c93303 190 'archetypes' => array(
57ca97b3
EL
191 'manager' => CAP_ALLOW
192 )
193 ),
194
2fdde5d1 195 'moodle/restore:restorecourse' => array(
f2a0da6c 196
2fdde5d1 197 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
f2a0da6c 198
2fdde5d1 199 'captype' => 'write',
f2a0da6c 200 'contextlevel' => CONTEXT_COURSE,
31c93303 201 'archetypes' => array(
2fdde5d1 202 'editingteacher' => CAP_ALLOW,
4f0c2d00 203 'manager' => CAP_ALLOW
2fdde5d1
EL
204 ),
205
206 'clonepermissionsfrom' => 'moodle/site:restore'
f2a0da6c
EL
207 ),
208
57ca97b3
EL
209 'moodle/restore:restoresection' => array(
210
211 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
212
213 'captype' => 'write',
214 'contextlevel' => CONTEXT_COURSE,
31c93303 215 'archetypes' => array(
57ca97b3
EL
216 'editingteacher' => CAP_ALLOW,
217 'manager' => CAP_ALLOW
218 ),
219
220 'clonepermissionsfrom' => 'moodle/restore:restorecourse'
221 ),
222
223 'moodle/restore:restoreactivity' => array(
224
225 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
226
227 'captype' => 'write',
228 'contextlevel' => CONTEXT_MODULE,
31c93303 229 'archetypes' => array(
57ca97b3
EL
230 'editingteacher' => CAP_ALLOW,
231 'manager' => CAP_ALLOW
232 ),
233
234 'clonepermissionsfrom' => 'moodle/restore:restorecourse'
235 ),
236
237 'moodle/restore:restoretargethub' => array(
238
239 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
240
241 'captype' => 'write',
242 'contextlevel' => CONTEXT_COURSE,
31c93303 243 'archetypes' => array(
57ca97b3
EL
244 'editingteacher' => CAP_ALLOW,
245 'manager' => CAP_ALLOW
246 ),
247
248 'clonepermissionsfrom' => 'moodle/restore:restorecourse'
249 ),
250
157aa3a2 251 'moodle/restore:restoretargetimport' => array(
eef868d1 252
21b6db6e 253 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
254
bbbf2d40 255 'captype' => 'write',
f432bebf 256 'contextlevel' => CONTEXT_COURSE,
31c93303 257 'archetypes' => array(
7246585a 258 'editingteacher' => CAP_ALLOW,
4f0c2d00 259 'manager' => CAP_ALLOW
d2940003
EL
260 ),
261
157aa3a2 262 'clonepermissionsfrom' => 'moodle/site:import'
bbbf2d40 263 ),
eef868d1 264
157aa3a2 265 'moodle/restore:uploadfile' => array(
5e934890 266
157aa3a2 267 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
5e934890
EL
268
269 'captype' => 'write',
157aa3a2 270 'contextlevel' => CONTEXT_COURSE,
31c93303 271 'archetypes' => array(
157aa3a2 272 'editingteacher' => CAP_ALLOW,
4f0c2d00 273 'manager' => CAP_ALLOW
157aa3a2
EL
274 ),
275
276 'clonepermissionsfrom' => 'moodle/site:backupupload'
5e934890
EL
277 ),
278
57ca97b3 279 'moodle/restore:configure' => array(
f6459d12 280
57ca97b3 281 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
f6459d12
EL
282
283 'captype' => 'write',
284 'contextlevel' => CONTEXT_COURSE,
31c93303 285 'archetypes' => array(
57ca97b3 286 'editingteacher' => CAP_ALLOW,
4f0c2d00 287 'manager' => CAP_ALLOW
f6459d12
EL
288 )
289 ),
290
57ca97b3 291 'moodle/restore:rolldates' => array(
157aa3a2
EL
292
293 'captype' => 'write',
57ca97b3 294 'contextlevel' => CONTEXT_COURSE,
31c93303 295 'archetypes' => array(
57ca97b3 296 'coursecreator' => CAP_ALLOW,
4f0c2d00 297 'manager' => CAP_ALLOW
157aa3a2
EL
298 )
299 ),
300
57ca97b3
EL
301 'moodle/restore:userinfo' => array(
302
303 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
982e45af 304
305 'captype' => 'write',
306 'contextlevel' => CONTEXT_COURSE,
31c93303 307 'archetypes' => array(
57ca97b3
EL
308 'manager' => CAP_ALLOW
309 )
310 ),
311
312 'moodle/restore:createuser' => array(
313
314 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
315
316 'captype' => 'write',
317 'contextlevel' => CONTEXT_SYSTEM,
31c93303 318 'archetypes' => array(
4f0c2d00 319 'manager' => CAP_ALLOW
982e45af 320 )
321 ),
322
bbbf2d40 323 'moodle/site:manageblocks' => array(
eef868d1 324
21b6db6e 325 'riskbitmask' => RISK_SPAM | RISK_XSS,
326
bbbf2d40 327 'captype' => 'write',
f432bebf 328 'contextlevel' => CONTEXT_BLOCK,
31c93303 329 'archetypes' => array(
73b73d21 330 'editingteacher' => CAP_ALLOW,
4f0c2d00 331 'manager' => CAP_ALLOW
bbbf2d40 332 )
333 ),
eef868d1 334
27950688 335 'moodle/site:accessallgroups' => array(
eef868d1 336
27950688 337 'captype' => 'read',
f432bebf 338 'contextlevel' => CONTEXT_COURSE,
31c93303 339 'archetypes' => array(
27950688 340 'teacher' => CAP_ALLOW,
341 'editingteacher' => CAP_ALLOW,
4f0c2d00 342 'manager' => CAP_ALLOW
27950688 343 )
344 ),
eef868d1 345
53d7785b 346 'moodle/site:viewfullnames' => array(
eef868d1 347
53d7785b 348 'captype' => 'read',
f432bebf 349 'contextlevel' => CONTEXT_COURSE,
31c93303 350 'archetypes' => array(
53d7785b 351 'teacher' => CAP_ALLOW,
352 'editingteacher' => CAP_ALLOW,
4f0c2d00 353 'manager' => CAP_ALLOW
53d7785b 354 )
355 ),
eef868d1 356
a028c291 357 'moodle/site:viewreports' => array(
eef868d1 358
21b6db6e 359 'riskbitmask' => RISK_PERSONAL,
360
a028c291 361 'captype' => 'read',
f432bebf 362 'contextlevel' => CONTEXT_COURSE,
31c93303 363 'archetypes' => array(
a028c291 364 'teacher' => CAP_ALLOW,
365 'editingteacher' => CAP_ALLOW,
4f0c2d00 366 'manager' => CAP_ALLOW
a028c291 367 )
368 ),
eef868d1 369
7d8a3cb0 370 'moodle/site:trustcontent' => array(
eef868d1 371
21b6db6e 372 'riskbitmask' => RISK_XSS,
373
7d8a3cb0 374 'captype' => 'write',
f432bebf 375 'contextlevel' => CONTEXT_COURSE,
31c93303 376 'archetypes' => array(
7d8a3cb0 377 'editingteacher' => CAP_ALLOW,
4f0c2d00 378 'manager' => CAP_ALLOW
7d8a3cb0 379 )
380 ),
eef868d1 381
6df3c7df 382 'moodle/site:uploadusers' => array(
eef868d1 383
21b6db6e 384 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
385
bbbf2d40 386 'captype' => 'write',
387 'contextlevel' => CONTEXT_SYSTEM,
31c93303 388 'archetypes' => array(
4f0c2d00 389 'manager' => CAP_ALLOW
bbbf2d40 390 )
391 ),
eef868d1 392
2a55410b 393 'moodle/site:langeditmaster' => array(
394
395 'riskbitmask' => RISK_CONFIG | RISK_XSS,
396
397 'captype' => 'write',
398 'contextlevel' => CONTEXT_SYSTEM,
31c93303 399 'archetypes' => array(
2a55410b 400 )
401 ),
402
403 'moodle/site:langeditlocal' => array(
404
405 'riskbitmask' => RISK_CONFIG | RISK_XSS,
406
407 'captype' => 'write',
408 'contextlevel' => CONTEXT_SYSTEM,
31c93303 409 'archetypes' => array(
4f0c2d00 410 'manager' => CAP_ALLOW
2a55410b 411 )
412 ),
413
94211250 414 // Permission to manage filter setting overrides in subcontexts.
415 'moodle/filter:manage' => array(
416
417 'captype' => 'write',
418 'contextlevel' => CONTEXT_COURSE,
31c93303 419 'archetypes' => array(
94211250 420 'editingteacher' => CAP_ALLOW,
421 'coursecreator' => CAP_ALLOW,
4f0c2d00 422 'manager' => CAP_ALLOW,
94211250 423 )
424 ),
6df3c7df 425
426 'moodle/user:create' => array(
427
428 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
eef868d1 429
bbbf2d40 430 'captype' => 'write',
431 'contextlevel' => CONTEXT_SYSTEM,
31c93303 432 'archetypes' => array(
4f0c2d00 433 'manager' => CAP_ALLOW
bbbf2d40 434 )
435 ),
eef868d1 436
6df3c7df 437 'moodle/user:delete' => array(
cc891abe 438
3a0c6cca 439 'riskbitmask' => RISK_PERSONAL, RISK_DATALOSS,
bcdb0f19 440
cc891abe 441 'captype' => 'write',
442 'contextlevel' => CONTEXT_SYSTEM,
31c93303 443 'archetypes' => array(
4f0c2d00 444 'manager' => CAP_ALLOW
cc891abe 445 )
446 ),
447
6df3c7df 448 'moodle/user:update' => array(
cc891abe 449
450 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
21b6db6e 451
bbbf2d40 452 'captype' => 'write',
453 'contextlevel' => CONTEXT_SYSTEM,
31c93303 454 'archetypes' => array(
4f0c2d00 455 'manager' => CAP_ALLOW
bbbf2d40 456 )
457 ),
eef868d1 458
bbbf2d40 459 'moodle/user:viewdetails' => array(
eef868d1 460
e58eca72 461 'captype' => 'read',
f432bebf 462 'contextlevel' => CONTEXT_COURSE,
31c93303 463 'archetypes' => array(
22ae509e 464 'guest' => CAP_ALLOW,
465 'student' => CAP_ALLOW,
466 'teacher' => CAP_ALLOW,
467 'editingteacher' => CAP_ALLOW,
4f0c2d00 468 'manager' => CAP_ALLOW
bbbf2d40 469 )
470 ),
e58eca72 471
472 'moodle/user:viewhiddendetails' => array(
eef868d1 473
21b6db6e 474 'riskbitmask' => RISK_PERSONAL,
475
e58eca72 476 'captype' => 'read',
f432bebf 477 'contextlevel' => CONTEXT_COURSE,
31c93303 478 'archetypes' => array(
e58eca72 479 'teacher' => CAP_ALLOW,
480 'editingteacher' => CAP_ALLOW,
4f0c2d00 481 'manager' => CAP_ALLOW
e58eca72 482 )
483 ),
eef868d1 484
6c95827f 485 'moodle/user:loginas' => array(
486
487 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
488
489 'captype' => 'write',
490 'contextlevel' => CONTEXT_COURSE,
31c93303 491 'archetypes' => array(
4f0c2d00 492 'manager' => CAP_ALLOW
6c95827f 493 )
494 ),
495
03d9401e
MD
496 // can the user manage the system default profile page?
497 'moodle/user:managesyspages' => array(
498
499 'riskbitmap' => RISK_SPAM | RISK_PERSONAL | RISK_CONFIG,
500
501 'captype' => 'write',
502 'contextlevel' => CONTEXT_SYSTEM,
31c93303 503 'archetypes' => array(
03d9401e
MD
504 'manager' => CAP_ALLOW
505 )
506 ),
507
508 // can the user manage another user's profile page?
509 'moodle/user:manageblocks' => array(
510
511 'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
512
513 'captype' => 'write',
514 'contextlevel' => CONTEXT_USER
515 ),
516
517 // can the user manage their own profile page?
518 'moodle/user:manageownblocks' => array(
519
520 'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
521
522 'captype' => 'write',
523 'contextlevel' => CONTEXT_SYSTEM,
31c93303 524 'archetypes' => array(
03d9401e
MD
525 'user' => CAP_ALLOW,
526 )
527 ),
528
529 // can the user manage the system default dashboard page?
530 'moodle/my:configsyspages' => array(
531
532 'riskbitmap' => RISK_SPAM | RISK_PERSONAL | RISK_CONFIG,
533
534 'captype' => 'write',
535 'contextlevel' => CONTEXT_SYSTEM,
31c93303 536 'archetypes' => array(
03d9401e
MD
537 'manager' => CAP_ALLOW
538 )
539 ),
540
bbbf2d40 541 'moodle/role:assign' => array(
eef868d1 542
3a0c6cca 543 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
544
bbbf2d40 545 'captype' => 'write',
f432bebf 546 'contextlevel' => CONTEXT_COURSE,
31c93303 547 'archetypes' => array(
861fdcaa 548 'editingteacher' => CAP_ALLOW,
4f0c2d00 549 'manager' => CAP_ALLOW
68c52526 550 )
551 ),
eef868d1 552
01a2ce80
PS
553 'moodle/role:review' => array(
554
555 'riskbitmask' => RISK_PERSONAL,
556
557 'captype' => 'read',
558 'contextlevel' => CONTEXT_COURSE,
31c93303 559 'archetypes' => array(
01a2ce80
PS
560 'teacher' => CAP_ALLOW,
561 'editingteacher' => CAP_ALLOW,
4f0c2d00 562 'manager' => CAP_ALLOW
01a2ce80
PS
563 )
564 ),
565
68c52526 566 'moodle/role:override' => array(
eef868d1 567
bcdb0f19 568 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
569
68c52526 570 'captype' => 'write',
f432bebf 571 'contextlevel' => CONTEXT_COURSE,
31c93303 572 'archetypes' => array(
4f0c2d00 573 'manager' => CAP_ALLOW
bbbf2d40 574 )
575 ),
eef868d1 576
3a0c6cca 577 'moodle/role:safeoverride' => array(
578
579 'riskbitmask' => RISK_SPAM,
580
581 'captype' => 'write',
f432bebf 582 'contextlevel' => CONTEXT_COURSE,
31c93303 583 'archetypes' => array(
3a0c6cca 584 'editingteacher' => CAP_ALLOW
585 )
586 ),
587
bbbf2d40 588 'moodle/role:manage' => array(
eef868d1 589
bcdb0f19 590 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
591
bbbf2d40 592 'captype' => 'write',
593 'contextlevel' => CONTEXT_SYSTEM,
31c93303 594 'archetypes' => array(
4f0c2d00 595 'manager' => CAP_ALLOW
bbbf2d40 596 )
597 ),
f43ce1ad 598
20dd4cf5 599 'moodle/role:switchroles' => array(
bcdb0f19 600
3a0c6cca 601 'riskbitmask' => RISK_XSS | RISK_PERSONAL,
bcdb0f19 602
20dd4cf5 603 'captype' => 'read',
f432bebf 604 'contextlevel' => CONTEXT_COURSE,
31c93303 605 'archetypes' => array(
20dd4cf5 606 'editingteacher' => CAP_ALLOW,
4f0c2d00 607 'manager' => CAP_ALLOW
20dd4cf5 608 )
609 ),
610
8ed5dd63 611 // Create, update and delete course categories. (Deleting a course category
612 // does not let you delete the courses it contains, unless you also have
613 // moodle/course: delete.) Creating and deleting requires this permission in
614 // the parent category.
615 'moodle/category:manage' => array(
eef868d1 616
89a792ab 617 'riskbitmask' => RISK_XSS,
618
bbbf2d40 619 'captype' => 'write',
620 'contextlevel' => CONTEXT_COURSECAT,
31c93303 621 'archetypes' => array(
4f0c2d00 622 'manager' => CAP_ALLOW
8ed5dd63 623 ),
624 'clonepermissionsfrom' => 'moodle/category:update'
bbbf2d40 625 ),
eef868d1 626
8ed5dd63 627 'moodle/category:viewhiddencategories' => array(
eef868d1 628
8ed5dd63 629 'captype' => 'read',
bbbf2d40 630 'contextlevel' => CONTEXT_COURSECAT,
31c93303 631 'archetypes' => array(
8ed5dd63 632 'coursecreator' => CAP_ALLOW,
4f0c2d00 633 'manager' => CAP_ALLOW
8ed5dd63 634 ),
635 'clonepermissionsfrom' => 'moodle/category:visibility'
bbbf2d40 636 ),
eef868d1 637
3f791403
PS
638 // create, delete, move cohorts in system and course categories,
639 // (cohorts with component !== null can be only moved)
640 'moodle/cohort:manage' => array(
641
642 'captype' => 'write',
643 'contextlevel' => CONTEXT_COURSECAT,
31c93303 644 'archetypes' => array(
3f791403
PS
645 'manager' => CAP_ALLOW
646 )
647 ),
648
649 // add and remove cohort members (only for cohorts where component !== null)
650 'moodle/cohort:assign' => array(
651
652 'captype' => 'write',
653 'contextlevel' => CONTEXT_COURSECAT,
31c93303 654 'archetypes' => array(
3f791403
PS
655 'manager' => CAP_ALLOW
656 )
657 ),
658
659 // view members of a cohort, this can be used in course context too,
660 // this also controls the ability to actually use cohort
661 'moodle/cohort:view' => array(
662
663 'captype' => 'read',
664 'contextlevel' => CONTEXT_COURSE,
31c93303 665 'archetypes' => array(
3f791403
PS
666 'editingteacher' => CAP_ALLOW,
667 'manager' => CAP_ALLOW
668 )
669 ),
670
bbbf2d40 671 'moodle/course:create' => array(
eef868d1 672
21b6db6e 673 'riskbitmask' => RISK_XSS,
674
bbbf2d40 675 'captype' => 'write',
5e992f56 676 'contextlevel' => CONTEXT_COURSECAT,
31c93303 677 'archetypes' => array(
4473252d 678 'coursecreator' => CAP_ALLOW,
4f0c2d00 679 'manager' => CAP_ALLOW
bbbf2d40 680 )
681 ),
eef868d1 682
e452210a 683 'moodle/course:request' => array(
684 'captype' => 'write',
685 'contextlevel' => CONTEXT_SYSTEM,
31c93303 686 'archetypes' => array(
e452210a 687 'user' => CAP_ALLOW,
688 )
689 ),
690
bbbf2d40 691 'moodle/course:delete' => array(
eef868d1 692
3a0c6cca 693 'riskbitmask' => RISK_DATALOSS,
694
bbbf2d40 695 'captype' => 'write',
696 'contextlevel' => CONTEXT_COURSE,
31c93303 697 'archetypes' => array(
9136a60c 698 'editingteacher' => CAP_ALLOW,
4f0c2d00 699 'manager' => CAP_ALLOW
bbbf2d40 700 )
701 ),
eef868d1 702
bbbf2d40 703 'moodle/course:update' => array(
eef868d1 704
21b6db6e 705 'riskbitmask' => RISK_XSS,
706
bbbf2d40 707 'captype' => 'write',
708 'contextlevel' => CONTEXT_COURSE,
31c93303 709 'archetypes' => array(
bbbf2d40 710 'editingteacher' => CAP_ALLOW,
4f0c2d00 711 'manager' => CAP_ALLOW
bbbf2d40 712 )
713 ),
eef868d1 714
df997f84 715 'moodle/course:view' => array(
eef868d1 716
bbbf2d40 717 'captype' => 'read',
718 'contextlevel' => CONTEXT_COURSE,
31c93303 719 'archetypes' => array(
df997f84 720 'manager' => CAP_ALLOW,
bbbf2d40 721 )
722 ),
eef868d1 723
df997f84
PS
724 /* review course enrolments - no group restrictions, it is really full access to all participants info*/
725 'moodle/course:enrolreview' => array(
726
727 'riskbitmask' => RISK_PERSONAL,
4f0c2d00
PS
728
729 'captype' => 'read',
730 'contextlevel' => CONTEXT_COURSE,
31c93303 731 'archetypes' => array(
df997f84
PS
732 'editingteacher' => CAP_ALLOW,
733 'manager' => CAP_ALLOW,
734 )
735 ),
736
737 /* add, remove, hide enrol instances in courses */
738 'moodle/course:enrolconfig' => array(
739
740 'riskbitmask' => RISK_PERSONAL,
741
742 'captype' => 'write',
743 'contextlevel' => CONTEXT_COURSE,
744 'archetypes' => array(
745 'editingteacher' => CAP_ALLOW,
4f0c2d00
PS
746 'manager' => CAP_ALLOW,
747 )
748 ),
749
77c645df 750 'moodle/course:bulkmessaging' => array(
751
752 'riskbitmask' => RISK_SPAM,
753
754 'captype' => 'write',
755 'contextlevel' => CONTEXT_COURSE,
31c93303 756 'archetypes' => array(
77c645df 757 'teacher' => CAP_ALLOW,
758 'editingteacher' => CAP_ALLOW,
4f0c2d00 759 'manager' => CAP_ALLOW
77c645df 760 )
761 ),
762
1c45e42e 763 'moodle/course:viewhiddenuserfields' => array(
eef868d1 764
21b6db6e 765 'riskbitmask' => RISK_PERSONAL,
4e781c7b 766
767 'captype' => 'read',
768 'contextlevel' => CONTEXT_COURSE,
31c93303 769 'archetypes' => array(
4e781c7b 770 'teacher' => CAP_ALLOW,
771 'editingteacher' => CAP_ALLOW,
4f0c2d00 772 'manager' => CAP_ALLOW
4e781c7b 773 )
774 ),
775
1c45e42e 776 'moodle/course:viewhiddencourses' => array(
eef868d1 777
1c45e42e 778 'captype' => 'read',
779 'contextlevel' => CONTEXT_COURSE,
31c93303 780 'archetypes' => array(
2f5ab42b 781 'coursecreator' => CAP_ALLOW,
782 'teacher' => CAP_ALLOW,
783 'editingteacher' => CAP_ALLOW,
4f0c2d00 784 'manager' => CAP_ALLOW
1c45e42e 785 )
786 ),
eef868d1 787
bbbf2d40 788 'moodle/course:visibility' => array(
eef868d1 789
bbbf2d40 790 'captype' => 'write',
791 'contextlevel' => CONTEXT_COURSE,
31c93303 792 'archetypes' => array(
df997f84 793 'editingteacher' => CAP_ALLOW,
4f0c2d00 794 'manager' => CAP_ALLOW
bbbf2d40 795 )
796 ),
eef868d1 797
a028c291 798 'moodle/course:managefiles' => array(
eef868d1 799
21b6db6e 800 'riskbitmask' => RISK_XSS,
801
a028c291 802 'captype' => 'write',
803 'contextlevel' => CONTEXT_COURSE,
31c93303 804 'archetypes' => array(
a028c291 805 'editingteacher' => CAP_ALLOW,
4f0c2d00 806 'manager' => CAP_ALLOW
a028c291 807 )
808 ),
eef868d1 809
bbbf2d40 810 'moodle/course:manageactivities' => array(
eef868d1 811
21b6db6e 812 'riskbitmask' => RISK_XSS,
813
bbbf2d40 814 'captype' => 'write',
815 'contextlevel' => CONTEXT_COURSE,
31c93303 816 'archetypes' => array(
bbbf2d40 817 'editingteacher' => CAP_ALLOW,
4f0c2d00 818 'manager' => CAP_ALLOW
bbbf2d40 819 )
820 ),
eef868d1 821
bbbf2d40 822 'moodle/course:activityvisibility' => array(
eef868d1 823
bbbf2d40 824 'captype' => 'write',
825 'contextlevel' => CONTEXT_COURSE,
31c93303 826 'archetypes' => array(
bbbf2d40 827 'editingteacher' => CAP_ALLOW,
4f0c2d00 828 'manager' => CAP_ALLOW
bbbf2d40 829 )
830 ),
eef868d1 831
bbbf2d40 832 'moodle/course:viewhiddenactivities' => array(
eef868d1 833
bbbf2d40 834 'captype' => 'write',
835 'contextlevel' => CONTEXT_COURSE,
31c93303 836 'archetypes' => array(
bbbf2d40 837 'teacher' => CAP_ALLOW,
838 'editingteacher' => CAP_ALLOW,
4f0c2d00 839 'manager' => CAP_ALLOW
bbbf2d40 840 )
841 ),
eef868d1 842
bbbf2d40 843 'moodle/course:viewparticipants' => array(
eef868d1 844
bbbf2d40 845 'captype' => 'read',
846 'contextlevel' => CONTEXT_COURSE,
31c93303 847 'archetypes' => array(
bbbf2d40 848 'student' => CAP_ALLOW,
849 'teacher' => CAP_ALLOW,
850 'editingteacher' => CAP_ALLOW,
4f0c2d00 851 'manager' => CAP_ALLOW
165088f6 852 )
853 ),
f7c0d84b 854
855 'moodle/course:changefullname' => array(
856
cd7f72c0 857 'riskbitmask' => RISK_XSS,
858
f7c0d84b 859 'captype' => 'write',
860 'contextlevel' => CONTEXT_COURSE,
31c93303 861 'archetypes' => array(
f7c0d84b 862 'editingteacher' => CAP_ALLOW,
4f0c2d00 863 'manager' => CAP_ALLOW
5e99b9d7 864 ),
865 'clonepermissionsfrom' => 'moodle/course:update'
f7c0d84b 866 ),
867
868 'moodle/course:changeshortname' => array(
869
cd7f72c0 870 'riskbitmask' => RISK_XSS,
871
f7c0d84b 872 'captype' => 'write',
873 'contextlevel' => CONTEXT_COURSE,
31c93303 874 'archetypes' => array(
f7c0d84b 875 'editingteacher' => CAP_ALLOW,
4f0c2d00 876 'manager' => CAP_ALLOW
5e99b9d7 877 ),
878 'clonepermissionsfrom' => 'moodle/course:update'
f7c0d84b 879 ),
880
881 'moodle/course:changeidnumber' => array(
882
cd7f72c0 883 'riskbitmask' => RISK_XSS,
884
f7c0d84b 885 'captype' => 'write',
886 'contextlevel' => CONTEXT_COURSE,
31c93303 887 'archetypes' => array(
f7c0d84b 888 'editingteacher' => CAP_ALLOW,
4f0c2d00 889 'manager' => CAP_ALLOW
5e99b9d7 890 ),
891 'clonepermissionsfrom' => 'moodle/course:update'
f7c0d84b 892 ),
50569ba3 893 'moodle/course:changecategory' => array(
894 'riskbitmask' => RISK_XSS,
895
896 'captype' => 'write',
897 'contextlevel' => CONTEXT_COURSE,
31c93303 898 'archetypes' => array(
50569ba3 899 'editingteacher' => CAP_ALLOW,
4f0c2d00 900 'manager' => CAP_ALLOW
50569ba3 901 ),
902 'clonepermissionsfrom' => 'moodle/course:update'
903 ),
904
905 'moodle/course:changesummary' => array(
906 'riskbitmask' => RISK_XSS,
907
908 'captype' => 'write',
909 'contextlevel' => CONTEXT_COURSE,
31c93303 910 'archetypes' => array(
50569ba3 911 'editingteacher' => CAP_ALLOW,
4f0c2d00 912 'manager' => CAP_ALLOW
50569ba3 913 ),
914 'clonepermissionsfrom' => 'moodle/course:update'
915 ),
916
f7c0d84b 917
165088f6 918 'moodle/site:viewparticipants' => array(
919
920 'captype' => 'read',
921 'contextlevel' => CONTEXT_SYSTEM,
31c93303 922 'archetypes' => array(
4f0c2d00 923 'manager' => CAP_ALLOW
bbbf2d40 924 )
925 ),
eef868d1 926
bbbf2d40 927 'moodle/course:viewscales' => array(
eef868d1 928
bbbf2d40 929 'captype' => 'read',
930 'contextlevel' => CONTEXT_COURSE,
31c93303 931 'archetypes' => array(
bbbf2d40 932 'student' => CAP_ALLOW,
933 'teacher' => CAP_ALLOW,
934 'editingteacher' => CAP_ALLOW,
4f0c2d00 935 'manager' => CAP_ALLOW
bbbf2d40 936 )
937 ),
eef868d1 938
bbbf2d40 939 'moodle/course:managescales' => array(
eef868d1 940
bbbf2d40 941 'captype' => 'write',
942 'contextlevel' => CONTEXT_COURSE,
31c93303 943 'archetypes' => array(
bbbf2d40 944 'editingteacher' => CAP_ALLOW,
4f0c2d00 945 'manager' => CAP_ALLOW
bbbf2d40 946 )
947 ),
eef868d1 948
bbbf2d40 949 'moodle/course:managegroups' => array(
950
951 'captype' => 'write',
952 'contextlevel' => CONTEXT_COURSE,
31c93303 953 'archetypes' => array(
a028c291 954 'editingteacher' => CAP_ALLOW,
4f0c2d00 955 'manager' => CAP_ALLOW
a028c291 956 )
957 ),
eef868d1 958
a028c291 959 'moodle/course:reset' => array(
960
3a0c6cca 961 'riskbitmask' => RISK_DATALOSS,
962
a028c291 963 'captype' => 'write',
964 'contextlevel' => CONTEXT_COURSE,
31c93303 965 'archetypes' => array(
bbbf2d40 966 'editingteacher' => CAP_ALLOW,
4f0c2d00 967 'manager' => CAP_ALLOW
bbbf2d40 968 )
969 ),
eef868d1 970
bbbf2d40 971 'moodle/blog:view' => array(
972
973 'captype' => 'read',
05de723b 974 'contextlevel' => CONTEXT_SYSTEM,
31c93303 975 'archetypes' => array(
05de723b
NC
976 'guest' => CAP_ALLOW,
977 'user' => CAP_ALLOW,
978 'student' => CAP_ALLOW,
979 'teacher' => CAP_ALLOW,
980 'editingteacher' => CAP_ALLOW,
4f0c2d00 981 'manager' => CAP_ALLOW
05de723b
NC
982 )
983 ),
984
985 'moodle/blog:search' => array(
986 'captype' => 'read',
987 'contextlevel' => CONTEXT_SYSTEM,
31c93303 988 'archetypes' => array(
00adf177 989 'guest' => CAP_ALLOW,
c785d40a 990 'user' => CAP_ALLOW,
bbbf2d40 991 'student' => CAP_ALLOW,
992 'teacher' => CAP_ALLOW,
993 'editingteacher' => CAP_ALLOW,
4f0c2d00 994 'manager' => CAP_ALLOW
bbbf2d40 995 )
996 ),
eef868d1 997
05de723b
NC
998 'moodle/blog:viewdrafts' => array(
999
1000 'riskbitmask' => RISK_PERSONAL,
1001 'captype' => 'read',
1002 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1003 'archetypes' => array(
4f0c2d00 1004 'manager' => CAP_ALLOW
05de723b
NC
1005 )
1006 ),
1007
5a8ab2e9 1008 'moodle/blog:create' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 1009
21b6db6e 1010 'riskbitmask' => RISK_SPAM,
1011
bbbf2d40 1012 'captype' => 'write',
1013 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1014 'archetypes' => array(
c785d40a 1015 'user' => CAP_ALLOW,
4f0c2d00 1016 'manager' => CAP_ALLOW
bbbf2d40 1017 )
1018 ),
eef868d1 1019
bbbf2d40 1020 'moodle/blog:manageentries' => array(
1021
21b6db6e 1022 'riskbitmask' => RISK_SPAM,
1023
bbbf2d40 1024 'captype' => 'write',
05de723b 1025 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1026 'archetypes' => array(
bbbf2d40 1027 'teacher' => CAP_ALLOW,
1028 'editingteacher' => CAP_ALLOW,
4f0c2d00 1029 'manager' => CAP_ALLOW
bbbf2d40 1030 )
1031 ),
05de723b 1032
cae83708 1033 'moodle/blog:manageexternal' => array(
1034
1035 'riskbitmask' => RISK_SPAM,
1036
1037 'captype' => 'write',
1038 'contextlevel' => CONTEXT_USER,
31c93303 1039 'archetypes' => array(
cae83708 1040 'student' => CAP_ALLOW,
1041 'user' => CAP_ALLOW,
1042 'teacher' => CAP_ALLOW,
1043 'editingteacher' => CAP_ALLOW,
4f0c2d00 1044 'manager' => CAP_ALLOW
cae83708 1045 )
1046 ),
1047
05de723b
NC
1048 'moodle/blog:associatecourse' => array(
1049
1050 'captype' => 'write',
1051 'contextlevel' => CONTEXT_COURSE,
31c93303 1052 'archetypes' => array(
05de723b
NC
1053 'student' => CAP_ALLOW,
1054 'user' => CAP_ALLOW,
1055 'teacher' => CAP_ALLOW,
1056 'editingteacher' => CAP_ALLOW,
4f0c2d00 1057 'manager' => CAP_ALLOW
05de723b
NC
1058 )
1059 ),
1060
1061 'moodle/blog:associatemodule' => array(
1062
1063 'captype' => 'write',
1064 'contextlevel' => CONTEXT_MODULE,
31c93303 1065 'archetypes' => array(
05de723b
NC
1066 'student' => CAP_ALLOW,
1067 'user' => CAP_ALLOW,
1068 'teacher' => CAP_ALLOW,
1069 'editingteacher' => CAP_ALLOW,
4f0c2d00 1070 'manager' => CAP_ALLOW
05de723b
NC
1071 )
1072 ),
eef868d1 1073
5a8ab2e9 1074 'moodle/calendar:manageownentries' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 1075
21b6db6e 1076 'riskbitmask' => RISK_SPAM,
1077
bbbf2d40 1078 'captype' => 'write',
f432bebf 1079 'contextlevel' => CONTEXT_COURSE,
31c93303 1080 'archetypes' => array(
c785d40a 1081 'user' => CAP_ALLOW,
4f0c2d00 1082 'manager' => CAP_ALLOW
bbbf2d40 1083 )
1084 ),
eef868d1 1085
f63d2922 1086 'moodle/calendar:managegroupentries' => array(
1087
1088 'riskbitmask' => RISK_SPAM,
1089
1090 'captype' => 'write',
f432bebf 1091 'contextlevel' => CONTEXT_COURSE,
31c93303 1092 'archetypes' => array(
f63d2922 1093 'teacher' => CAP_ALLOW,
1094 'editingteacher' => CAP_ALLOW,
4f0c2d00 1095 'manager' => CAP_ALLOW
f63d2922 1096 )
1097 ),
1098
bbbf2d40 1099 'moodle/calendar:manageentries' => array(
1100
21b6db6e 1101 'riskbitmask' => RISK_SPAM,
1102
bbbf2d40 1103 'captype' => 'write',
f432bebf 1104 'contextlevel' => CONTEXT_COURSE,
31c93303 1105 'archetypes' => array(
bbbf2d40 1106 'teacher' => CAP_ALLOW,
1107 'editingteacher' => CAP_ALLOW,
4f0c2d00 1108 'manager' => CAP_ALLOW
bbbf2d40 1109 )
77d4953e 1110 ),
a044c05d 1111
1112 'moodle/user:editprofile' => array(
1113
3a0c6cca 1114 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
a044c05d 1115
1116 'captype' => 'write',
1117 'contextlevel' => CONTEXT_USER,
31c93303 1118 'archetypes' => array(
4f0c2d00 1119 'manager' => CAP_ALLOW
a044c05d 1120 )
1121 ),
eef868d1 1122
a5b8be62 1123 'moodle/user:editownprofile' => array(
1cb3da36 1124
3a0c6cca 1125 'riskbitmask' => RISK_SPAM,
1126
a5b8be62 1127 'captype' => 'write',
1128 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1129 'archetypes' => array(
1cb3da36 1130 'guest' => CAP_PROHIBIT,
1131 'user' => CAP_ALLOW,
4f0c2d00 1132 'manager' => CAP_ALLOW
a5b8be62 1133 )
1cb3da36 1134 ),
1135
a5b8be62 1136 'moodle/user:changeownpassword' => array(
1cb3da36 1137
a5b8be62 1138 'captype' => 'write',
1139 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1140 'archetypes' => array(
1cb3da36 1141 'guest' => CAP_PROHIBIT,
1142 'user' => CAP_ALLOW,
4f0c2d00 1143 'manager' => CAP_ALLOW
a5b8be62 1144 )
1cb3da36 1145 ),
1146
eef868d1 1147 // The next 3 might make no sense for some roles, e.g teacher, etc.
77d4953e 1148 // since the next level up is site. These are more for the parent role
1149 'moodle/user:readuserposts' => array(
bcdb0f19 1150
77d4953e 1151 'captype' => 'read',
4b10f08b 1152 'contextlevel' => CONTEXT_USER,
31c93303 1153 'archetypes' => array(
77d4953e 1154 'student' => CAP_ALLOW,
1155 'teacher' => CAP_ALLOW,
1156 'editingteacher' => CAP_ALLOW,
4f0c2d00 1157 'manager' => CAP_ALLOW
77d4953e 1158 )
1159 ),
eef868d1 1160
77d4953e 1161 'moodle/user:readuserblogs' => array(
bcdb0f19 1162
77d4953e 1163 'captype' => 'read',
4b10f08b 1164 'contextlevel' => CONTEXT_USER,
31c93303 1165 'archetypes' => array(
77d4953e 1166 'student' => CAP_ALLOW,
1167 'teacher' => CAP_ALLOW,
1168 'editingteacher' => CAP_ALLOW,
4f0c2d00 1169 'manager' => CAP_ALLOW
77d4953e 1170 )
1171 ),
eef868d1 1172
3c7da16d 1173 // designed for parent role - not used in legacy roles
77d4953e 1174 'moodle/user:viewuseractivitiesreport' => array(
3c7da16d 1175 'riskbitmask' => RISK_PERSONAL,
bcdb0f19 1176
77d4953e 1177 'captype' => 'read',
4b10f08b 1178 'contextlevel' => CONTEXT_USER,
31c93303 1179 'archetypes' => array(
77d4953e 1180 )
945f88ca 1181 ),
4e781c7b 1182
3b120e46 1183 //capabilities designed for the new message system configuration
1184 'moodle/user:editmessageprofile' => array(
f7c0d84b 1185
3b120e46 1186 'riskbitmask' => RISK_SPAM,
f7c0d84b 1187
3b120e46 1188 'captype' => 'write',
1189 'contextlevel' => CONTEXT_USER,
31c93303 1190 'archetypes' => array(
4f0c2d00 1191 'manager' => CAP_ALLOW
3b120e46 1192 )
1193 ),
f7c0d84b 1194
1195 'moodle/user:editownmessageprofile' => array(
1196
1197 'captype' => 'write',
1198 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1199 'archetypes' => array(
3b120e46 1200 'guest' => CAP_PROHIBIT,
1201 'user' => CAP_ALLOW,
4f0c2d00 1202 'manager' => CAP_ALLOW
f7c0d84b 1203 )
3b120e46 1204 ),
eef868d1 1205
271e6dec 1206 'moodle/question:managecategory' => array(
14d701d6 1207 'riskbitmask' => RISK_SPAM | RISK_XSS,
945f88ca 1208 'captype' => 'write',
1209 'contextlevel' => CONTEXT_COURSE,
31c93303 1210 'archetypes' => array(
945f88ca 1211 'editingteacher' => CAP_ALLOW,
4f0c2d00 1212 'manager' => CAP_ALLOW
945f88ca 1213 )
a5b8be62 1214 ),
1215
271e6dec 1216 //new in moodle 1.9
1217 'moodle/question:add' => array(
14d701d6 1218 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1219 'captype' => 'write',
1220 'contextlevel' => CONTEXT_COURSE,
31c93303 1221 'archetypes' => array(
271e6dec 1222 'editingteacher' => CAP_ALLOW,
4f0c2d00 1223 'manager' => CAP_ALLOW
271e6dec 1224 ),
1225 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1226 ),
271e6dec 1227 'moodle/question:editmine' => array(
14d701d6 1228 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1229 'captype' => 'write',
1230 'contextlevel' => CONTEXT_COURSE,
31c93303 1231 'archetypes' => array(
271e6dec 1232 'editingteacher' => CAP_ALLOW,
4f0c2d00 1233 'manager' => CAP_ALLOW
271e6dec 1234 ),
a5b8be62 1235 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1236 ),
1237 'moodle/question:editall' => array(
14d701d6 1238 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1239 'captype' => 'write',
1240 'contextlevel' => CONTEXT_COURSE,
31c93303 1241 'archetypes' => array(
271e6dec 1242 'editingteacher' => CAP_ALLOW,
4f0c2d00 1243 'manager' => CAP_ALLOW
271e6dec 1244 ),
a5b8be62 1245 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1246 ),
1247 'moodle/question:viewmine' => array(
945f88ca 1248 'captype' => 'read',
1249 'contextlevel' => CONTEXT_COURSE,
31c93303 1250 'archetypes' => array(
945f88ca 1251 'editingteacher' => CAP_ALLOW,
4f0c2d00 1252 'manager' => CAP_ALLOW
271e6dec 1253 ),
a5b8be62 1254 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1255 ),
271e6dec 1256 'moodle/question:viewall' => array(
1257 'captype' => 'read',
1258 'contextlevel' => CONTEXT_COURSE,
31c93303 1259 'archetypes' => array(
271e6dec 1260 'editingteacher' => CAP_ALLOW,
4f0c2d00 1261 'manager' => CAP_ALLOW
271e6dec 1262 ),
a5b8be62 1263 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1264 ),
1265 'moodle/question:usemine' => array(
1266 'captype' => 'read',
1267 'contextlevel' => CONTEXT_COURSE,
31c93303 1268 'archetypes' => array(
271e6dec 1269 'editingteacher' => CAP_ALLOW,
4f0c2d00 1270 'manager' => CAP_ALLOW
271e6dec 1271 ),
a5b8be62 1272 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1273 ),
1274 'moodle/question:useall' => array(
1275 'captype' => 'read',
1276 'contextlevel' => CONTEXT_COURSE,
31c93303 1277 'archetypes' => array(
271e6dec 1278 'editingteacher' => CAP_ALLOW,
4f0c2d00 1279 'manager' => CAP_ALLOW
271e6dec 1280 ),
a5b8be62 1281 'clonepermissionsfrom' => 'moodle/question:manage'
1282 ),
271e6dec 1283 'moodle/question:movemine' => array(
945f88ca 1284 'captype' => 'write',
1285 'contextlevel' => CONTEXT_COURSE,
31c93303 1286 'archetypes' => array(
945f88ca 1287 'editingteacher' => CAP_ALLOW,
4f0c2d00 1288 'manager' => CAP_ALLOW
271e6dec 1289 ),
a5b8be62 1290 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1291 ),
271e6dec 1292 'moodle/question:moveall' => array(
945f88ca 1293 'captype' => 'write',
1294 'contextlevel' => CONTEXT_COURSE,
31c93303 1295 'archetypes' => array(
945f88ca 1296 'editingteacher' => CAP_ALLOW,
4f0c2d00 1297 'manager' => CAP_ALLOW
271e6dec 1298 ),
a5b8be62 1299 'clonepermissionsfrom' => 'moodle/question:manage'
7191a1fa 1300 ),
271e6dec 1301 //END new in moodle 1.9
a5b8be62 1302
0eb6b04a 1303 // Configure the installed question types.
1304 'moodle/question:config' => array(
0eb6b04a 1305 'riskbitmask' => RISK_CONFIG,
0eb6b04a 1306 'captype' => 'write',
1307 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1308 'archetypes' => array(
4f0c2d00 1309 'manager' => CAP_ALLOW
0eb6b04a 1310 )
1311 ),
1312
62e76c67 1313 // While attempting questions, the ability to flag particular questions for later reference.
1314 'moodle/question:flag' => array(
1315 'captype' => 'write',
1316 'contextlevel' => CONTEXT_COURSE,
31c93303 1317 'archetypes' => array(
62e76c67 1318 'student' => CAP_ALLOW,
1319 'teacher' => CAP_ALLOW,
1320 'editingteacher' => CAP_ALLOW,
1321 'coursecreator' => CAP_ALLOW,
4f0c2d00 1322 'manager' => CAP_ALLOW
62e76c67 1323 )
1324 ),
bcdb0f19 1325
62e76c67 1326 'moodle/site:doclinks' => array(
7191a1fa 1327 'captype' => 'read',
1328 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1329 'archetypes' => array(
7191a1fa 1330 'teacher' => CAP_ALLOW,
1331 'editingteacher' => CAP_ALLOW,
4f0c2d00 1332 'manager' => CAP_ALLOW
7191a1fa 1333 )
3924b988 1334 ),
eef868d1 1335
3924b988 1336 'moodle/course:sectionvisibility' => array(
bcdb0f19 1337
3924b988 1338 'captype' => 'write',
1339 'contextlevel' => CONTEXT_COURSE,
31c93303 1340 'archetypes' => array(
3924b988 1341 'editingteacher' => CAP_ALLOW,
4f0c2d00 1342 'manager' => CAP_ALLOW
3924b988 1343 )
1344 ),
eef868d1 1345
dc558690 1346 'moodle/course:useremail' => array(
bcdb0f19 1347
dc558690 1348 'captype' => 'write',
1349 'contextlevel' => CONTEXT_COURSE,
31c93303 1350 'archetypes' => array(
dc558690 1351 'editingteacher' => CAP_ALLOW,
4f0c2d00 1352 'manager' => CAP_ALLOW
dc558690 1353 )
1354 ),
eef868d1 1355
3924b988 1356 'moodle/course:viewhiddensections' => array(
bcdb0f19 1357
3924b988 1358 'captype' => 'write',
1359 'contextlevel' => CONTEXT_COURSE,
31c93303 1360 'archetypes' => array(
3924b988 1361 'editingteacher' => CAP_ALLOW,
4f0c2d00 1362 'manager' => CAP_ALLOW
3924b988 1363 )
1364 ),
eef868d1 1365
3924b988 1366 'moodle/course:setcurrentsection' => array(
bcdb0f19 1367
3924b988 1368 'captype' => 'write',
1369 'contextlevel' => CONTEXT_COURSE,
31c93303 1370 'archetypes' => array(
3924b988 1371 'editingteacher' => CAP_ALLOW,
4f0c2d00 1372 'manager' => CAP_ALLOW
3924b988 1373 )
1374 ),
eef868d1 1375
dd45888a 1376 'moodle/site:mnetlogintoremote' => array(
bc4c9800 1377
3924b988 1378 'captype' => 'read',
dd45888a 1379 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1380 'archetypes' => array(
3924b988 1381 )
1382 ),
eef868d1 1383
dd45888a 1384 'moodle/grade:viewall' => array(
bcdb0f19 1385 'riskbitmask' => RISK_PERSONAL,
dd45888a 1386 'captype' => 'read',
eecf76df 1387 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_USER
31c93303 1388 'archetypes' => array(
dd45888a 1389 'teacher' => CAP_ALLOW,
3924b988 1390 'editingteacher' => CAP_ALLOW,
4f0c2d00 1391 'manager' => CAP_ALLOW
dd45888a 1392 ),
1393 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
f509ce06 1394 ),
f43ce1ad 1395
dd45888a 1396 'moodle/grade:view' => array(
f509ce06 1397 'captype' => 'read',
eecf76df 1398 'contextlevel' => CONTEXT_COURSE,
31c93303 1399 'archetypes' => array(
dd45888a 1400 'student' => CAP_ALLOW
f509ce06 1401 )
ca9ffa18 1402 ),
dd45888a 1403
1404 'moodle/grade:viewhidden' => array(
ca9ffa18 1405 'riskbitmask' => RISK_PERSONAL,
1406 'captype' => 'read',
eecf76df 1407 'contextlevel' => CONTEXT_COURSE,
31c93303 1408 'archetypes' => array(
0371f8e5 1409 'teacher' => CAP_ALLOW,
1410 'editingteacher' => CAP_ALLOW,
4f0c2d00 1411 'manager' => CAP_ALLOW
dd45888a 1412 ),
1413 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
ca9ffa18 1414 ),
dd45888a 1415
1416 'moodle/grade:import' => array(
3a0c6cca 1417 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
dd45888a 1418 'captype' => 'write',
ca9ffa18 1419 'contextlevel' => CONTEXT_COURSE,
31c93303 1420 'archetypes' => array(
ca9ffa18 1421 'editingteacher' => CAP_ALLOW,
4f0c2d00 1422 'manager' => CAP_ALLOW
dd45888a 1423 ),
1424 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1425 ),
dd45888a 1426
1427 'moodle/grade:export' => array(
ca9ffa18 1428 'riskbitmask' => RISK_PERSONAL,
1429 'captype' => 'read',
1430 'contextlevel' => CONTEXT_COURSE,
31c93303 1431 'archetypes' => array(
ca9ffa18 1432 'teacher' => CAP_ALLOW,
1433 'editingteacher' => CAP_ALLOW,
4f0c2d00 1434 'manager' => CAP_ALLOW
dd45888a 1435 ),
1436 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1437 ),
dd45888a 1438
1439 'moodle/grade:manage' => array(
3a0c6cca 1440 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
dd45888a 1441 'captype' => 'write',
1442 'contextlevel' => CONTEXT_COURSE,
31c93303 1443 'archetypes' => array(
dd45888a 1444 'editingteacher' => CAP_ALLOW,
4f0c2d00 1445 'manager' => CAP_ALLOW
dd45888a 1446 ),
1447 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1448 ),
dd45888a 1449
a5b8be62 1450 'moodle/grade:edit' => array(
1451 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
04259694 1452 'captype' => 'write',
1453 'contextlevel' => CONTEXT_COURSE,
31c93303 1454 'archetypes' => array(
04259694 1455 'editingteacher' => CAP_ALLOW,
4f0c2d00 1456 'manager' => CAP_ALLOW
04259694 1457 ),
1458 'clonepermissionsfrom' => 'moodle/course:managegrades'
1459 ),
1460
a5b8be62 1461 'moodle/grade:manageoutcomes' => array(
284abb09 1462 'captype' => 'write',
1463 'contextlevel' => CONTEXT_COURSE,
31c93303 1464 'archetypes' => array(
284abb09 1465 'editingteacher' => CAP_ALLOW,
4f0c2d00 1466 'manager' => CAP_ALLOW
284abb09 1467 ),
1468 'clonepermissionsfrom' => 'moodle/course:managegrades'
1469 ),
1470
1471 'moodle/grade:manageletters' => array(
ca9ffa18 1472 'captype' => 'write',
1473 'contextlevel' => CONTEXT_COURSE,
31c93303 1474 'archetypes' => array(
ca9ffa18 1475 'editingteacher' => CAP_ALLOW,
4f0c2d00 1476 'manager' => CAP_ALLOW
a5b8be62 1477 ),
1478 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1479 ),
dd45888a 1480
a5b8be62 1481 'moodle/grade:hide' => array(
ca9ffa18 1482 'captype' => 'write',
1483 'contextlevel' => CONTEXT_COURSE,
31c93303 1484 'archetypes' => array(
ca9ffa18 1485 'editingteacher' => CAP_ALLOW,
4f0c2d00 1486 'manager' => CAP_ALLOW
ca9ffa18 1487 )
1488 ),
dd45888a 1489
a5b8be62 1490 'moodle/grade:lock' => array(
dd45888a 1491 'captype' => 'write',
ca9ffa18 1492 'contextlevel' => CONTEXT_COURSE,
31c93303 1493 'archetypes' => array(
ca9ffa18 1494 'editingteacher' => CAP_ALLOW,
4f0c2d00 1495 'manager' => CAP_ALLOW
ca9ffa18 1496 )
1497 ),
dd45888a 1498
a5b8be62 1499 'moodle/grade:unlock' => array(
ca9ffa18 1500 'captype' => 'write',
1501 'contextlevel' => CONTEXT_COURSE,
31c93303 1502 'archetypes' => array(
ca9ffa18 1503 'editingteacher' => CAP_ALLOW,
4f0c2d00 1504 'manager' => CAP_ALLOW
ca9ffa18 1505 )
282c1695 1506 ),
dd45888a 1507
1508 'moodle/my:manageblocks' => array(
282c1695 1509 'captype' => 'write',
1510 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1511 'archetypes' => array(
282c1695 1512 'user' => CAP_ALLOW
1513 )
eca3af25 1514 ),
dd45888a 1515
eca3af25 1516 'moodle/notes:view' => array(
1517 'captype' => 'read',
f432bebf 1518 'contextlevel' => CONTEXT_COURSE,
31c93303 1519 'archetypes' => array(
eca3af25 1520 'teacher' => CAP_ALLOW,
1521 'editingteacher' => CAP_ALLOW,
4f0c2d00 1522 'manager' => CAP_ALLOW
eca3af25 1523 )
1524 ),
1525
1526 'moodle/notes:manage' => array(
3a0c6cca 1527 'riskbitmask' => RISK_SPAM,
1528
eca3af25 1529 'captype' => 'write',
f432bebf 1530 'contextlevel' => CONTEXT_COURSE,
31c93303 1531 'archetypes' => array(
eca3af25 1532 'teacher' => CAP_ALLOW,
1533 'editingteacher' => CAP_ALLOW,
4f0c2d00 1534 'manager' => CAP_ALLOW
eca3af25 1535 )
dd45888a 1536 ),
79642064 1537
1538 'moodle/tag:manage' => array(
3a0c6cca 1539 'riskbitmask' => RISK_SPAM,
1540
79642064 1541 'captype' => 'write',
1542 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1543 'archetypes' => array(
79642064 1544 'teacher' => CAP_ALLOW,
1545 'editingteacher' => CAP_ALLOW,
4f0c2d00 1546 'manager' => CAP_ALLOW
79642064 1547 )
705789bd 1548 ),
1549
1550 'moodle/tag:create' => array(
3a0c6cca 1551 'riskbitmask' => RISK_SPAM,
1552
705789bd 1553 'captype' => 'write',
1554 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1555 'archetypes' => array(
4f0c2d00 1556 'manager' => CAP_ALLOW,
0f07c40e 1557 'user' => CAP_ALLOW
705789bd 1558 )
1559 ),
a5b8be62 1560
705789bd 1561 'moodle/tag:edit' => array(
3a0c6cca 1562 'riskbitmask' => RISK_SPAM,
1563
705789bd 1564 'captype' => 'write',
1565 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1566 'archetypes' => array(
4f0c2d00 1567 'manager' => CAP_ALLOW,
3e6e529f 1568 'user' => CAP_ALLOW
98b5789d 1569 )
1570 ),
a5b8be62 1571
98b5789d 1572 'moodle/tag:editblocks' => array(
1573 'captype' => 'write',
1574 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1575 'archetypes' => array(
705789bd 1576 'teacher' => CAP_ALLOW,
1577 'editingteacher' => CAP_ALLOW,
4f0c2d00 1578 'manager' => CAP_ALLOW
705789bd 1579 )
7e874772 1580 ),
1581
1582 'moodle/block:view' => array(
1583 'captype' => 'read',
1584 'contextlevel' => CONTEXT_BLOCK,
31c93303 1585 'archetypes' => array(
7e874772 1586 'guest' => CAP_ALLOW,
25a7d980 1587 'user' => CAP_ALLOW,
1588 'student' => CAP_ALLOW,
1589 'teacher' => CAP_ALLOW,
1590 'editingteacher' => CAP_ALLOW,
1591 'coursecreator' => CAP_ALLOW
7e874772 1592 )
8512f577 1593 ),
1594
d14edf06 1595 'moodle/block:edit' => array(
1596 'riskbitmask' => RISK_SPAM | RISK_XSS,
1597
1598 'captype' => 'write',
1599 'contextlevel' => CONTEXT_BLOCK,
31c93303 1600 'archetypes' => array(
d14edf06 1601 'editingteacher' => CAP_ALLOW,
1602 'coursecreator' => CAP_ALLOW
1603 )
1604 ),
1605
8512f577 1606 'moodle/portfolio:export' => array(
1607 'captype' => 'read',
1608 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1609 'archetypes' => array(
8512f577 1610 'user' => CAP_ALLOW,
1611 'student' => CAP_ALLOW,
1612 'teacher' => CAP_ALLOW,
1613 'editingteacher' => CAP_ALLOW,
1614 'coursecreator' => CAP_ALLOW
1615 )
1bcb7eb5 1616 ),
1617 'moodle/comment:view' => array(
1618
1619 'captype' => 'read',
1620 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1621 'archetypes' => array(
1bcb7eb5 1622 'user' => CAP_ALLOW,
1623 'student' => CAP_ALLOW,
1624 'teacher' => CAP_ALLOW,
1625 'editingteacher' => CAP_ALLOW,
1626 'coursecreator' => CAP_ALLOW,
4f0c2d00 1627 'manager' => CAP_ALLOW
1bcb7eb5 1628 )
1629 ),
1630 'moodle/comment:post' => array(
1631
1632 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
1633 'captype' => 'write',
1634 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1635 'archetypes' => array(
1bcb7eb5 1636 'user' => CAP_ALLOW,
1637 'student' => CAP_ALLOW,
1638 'teacher' => CAP_ALLOW,
1639 'editingteacher' => CAP_ALLOW,
1640 'coursecreator' => CAP_ALLOW,
4f0c2d00 1641 'manager' => CAP_ALLOW
1bcb7eb5 1642 )
1643 ),
1644 'moodle/comment:delete' => array(
1645
1646 'riskbitmask' => RISK_DATALOSS,
1647 'captype' => 'write',
1648 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1649 'archetypes' => array(
1bcb7eb5 1650 'editingteacher' => CAP_ALLOW,
1651 'coursecreator' => CAP_ALLOW,
4f0c2d00 1652 'manager' => CAP_ALLOW
1bcb7eb5 1653 )
5eacbd4b 1654 ),
1655 'moodle/webservice:createtoken' => array(
1656
52dd27bf 1657 'riskbitmask' => RISK_CONFIG | RISK_DATALOSS | RISK_SPAM | RISK_PERSONAL | RISK_XSS,
5eacbd4b 1658 'captype' => 'write',
1659 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1660 'archetypes' => array(
4f0c2d00 1661 'manager' => CAP_ALLOW
5eacbd4b 1662 )
a09aeee4 1663 ),
19fae119 1664 'moodle/rating:view' => array(
a09aeee4
AD
1665 'captype' => 'read',
1666 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1667 'archetypes' => array(
e116a818
AD
1668 'student' => CAP_ALLOW,
1669 'teacher' => CAP_ALLOW,
1670 'editingteacher' => CAP_ALLOW,
4f0c2d00 1671 'manager' => CAP_ALLOW
a09aeee4
AD
1672 )
1673 ),
6595a568
MD
1674 'moodle/rating:viewany' => array(
1675 'riskbitmask' => RISK_PERSONAL,
1676 'captype' => 'read',
1677 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1678 'archetypes' => array(
6595a568
MD
1679 'student' => CAP_ALLOW,
1680 'teacher' => CAP_ALLOW,
1681 'editingteacher' => CAP_ALLOW,
1682 'manager' => CAP_ALLOW
1683 )
1684 ),
19fae119 1685 'moodle/rating:viewall' => array(
a09aeee4
AD
1686 'riskbitmask' => RISK_PERSONAL,
1687 'captype' => 'read',
1688 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1689 'archetypes' => array(
6595a568 1690 'student' => CAP_ALLOW,
e116a818
AD
1691 'teacher' => CAP_ALLOW,
1692 'editingteacher' => CAP_ALLOW,
4f0c2d00 1693 'manager' => CAP_ALLOW
a09aeee4
AD
1694 )
1695 ),
19fae119 1696 'moodle/rating:rate' => array(
a09aeee4
AD
1697 'captype' => 'write',
1698 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1699 'archetypes' => array(
6595a568 1700 'student' => CAP_ALLOW,
e116a818
AD
1701 'teacher' => CAP_ALLOW,
1702 'editingteacher' => CAP_ALLOW,
4f0c2d00 1703 'manager' => CAP_ALLOW
a09aeee4 1704 )
07ab0c80 1705 ),
1706 'moodle/course:publish' => array(
1707
1708 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
1709
1710 'captype' => 'write',
1711 'contextlevel' => CONTEXT_SYSTEM,
31c93303 1712 'archetypes' => array(
07ab0c80 1713 'manager' => CAP_ALLOW
1714 )
2be4d090
MD
1715 ),
1716 'moodle/course:markcomplete' => array(
1717 'captype' => 'write',
1718 'contextlevel' => CONTEXT_COURSE,
31c93303 1719 'archetypes' => array(
2be4d090
MD
1720 'teacher' => CAP_ALLOW,
1721 'editingteacher' => CAP_ALLOW,
1722 'coursecreator' => CAP_ALLOW,
1723 'manager' => CAP_ALLOW
1724 )
755f96f8 1725 ),
1726 'moodle/community:add' => array(
1727 'captype' => 'write',
1728 'contextlevel' => CONTEXT_SYSTEM,
1729 'archetypes' => array(
1730 'manager' => CAP_ALLOW,
1731 'teacher' => CAP_ALLOW,
17957b8f 1732 'editingteacher' => CAP_ALLOW,
755f96f8 1733 'coursecreator' => CAP_ALLOW
1734 )
1735 ),
1736 'moodle/community:download' => array(
1737 'captype' => 'write',
1738 'contextlevel' => CONTEXT_SYSTEM,
1739 'archetypes' => array(
1740 'manager' => CAP_ALLOW,
17957b8f 1741 'editingteacher' => CAP_ALLOW,
755f96f8 1742 'coursecreator' => CAP_ALLOW
1743 )
79642064 1744 )
bbbf2d40 1745);