MDL-22061 get_mimetype_description() does not rely on get_string() returning square...
[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,
38 'legacy' => 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,
48 'legacy' => 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,
60 'legacy' => 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,
72 'legacy' => 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,
bbbf2d40 83 'legacy' => 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,
97 'legacy' => array(
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,
111 'legacy' => array(
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,
125 'legacy' => array(
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,
139 'legacy' => array(
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,
153 'legacy' => array(
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,
167 'legacy' => array(
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,
179 'legacy' => 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,
190 'legacy' => array(
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
EL
200 'contextlevel' => CONTEXT_COURSE,
201 'legacy' => 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,
215 'legacy' => array(
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,
229 'legacy' => array(
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,
243 'legacy' => array(
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,
bbbf2d40 257 'legacy' => 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,
5e934890 271 'legacy' => 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,
285 'legacy' => 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,
157aa3a2 295 'legacy' => 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,
307 'legacy' => 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,
318 'legacy' => 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,
bbbf2d40 329 'legacy' => 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,
27950688 339 'legacy' => 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,
53d7785b 350 'legacy' => 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,
a028c291 363 'legacy' => 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,
7d8a3cb0 376 'legacy' => 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,
388 'legacy' => 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,
399 'legacy' => 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,
409 'legacy' => 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,
419 'legacy' => array(
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,
432 'legacy' => 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,
443 'legacy' => 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,
454 'legacy' => 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,
bbbf2d40 463 'legacy' => 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,
e58eca72 478 'legacy' => 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,
491 'legacy' => array(
4f0c2d00 492 'manager' => CAP_ALLOW
6c95827f 493 )
494 ),
495
bbbf2d40 496 'moodle/role:assign' => array(
eef868d1 497
3a0c6cca 498 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
499
bbbf2d40 500 'captype' => 'write',
f432bebf 501 'contextlevel' => CONTEXT_COURSE,
bbbf2d40 502 'legacy' => array(
861fdcaa 503 'editingteacher' => CAP_ALLOW,
4f0c2d00 504 'manager' => CAP_ALLOW
68c52526 505 )
506 ),
eef868d1 507
01a2ce80
PS
508 'moodle/role:review' => array(
509
510 'riskbitmask' => RISK_PERSONAL,
511
512 'captype' => 'read',
513 'contextlevel' => CONTEXT_COURSE,
514 'legacy' => array(
515 'teacher' => CAP_ALLOW,
516 'editingteacher' => CAP_ALLOW,
4f0c2d00 517 'manager' => CAP_ALLOW
01a2ce80
PS
518 )
519 ),
520
68c52526 521 'moodle/role:override' => array(
eef868d1 522
bcdb0f19 523 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
524
68c52526 525 'captype' => 'write',
f432bebf 526 'contextlevel' => CONTEXT_COURSE,
68c52526 527 'legacy' => array(
4f0c2d00 528 'manager' => CAP_ALLOW
bbbf2d40 529 )
530 ),
eef868d1 531
3a0c6cca 532 'moodle/role:safeoverride' => array(
533
534 'riskbitmask' => RISK_SPAM,
535
536 'captype' => 'write',
f432bebf 537 'contextlevel' => CONTEXT_COURSE,
3a0c6cca 538 'legacy' => array(
539 'editingteacher' => CAP_ALLOW
540 )
541 ),
542
bbbf2d40 543 'moodle/role:manage' => array(
eef868d1 544
bcdb0f19 545 'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
546
bbbf2d40 547 'captype' => 'write',
548 'contextlevel' => CONTEXT_SYSTEM,
549 'legacy' => array(
4f0c2d00 550 'manager' => CAP_ALLOW
bbbf2d40 551 )
552 ),
f43ce1ad 553
554 'moodle/role:unassignself' => array(
bcdb0f19 555
f43ce1ad 556 'captype' => 'write',
f432bebf 557 'contextlevel' => CONTEXT_COURSE,
f43ce1ad 558 'legacy' => array(
2d5a4f25 559 'student' => (empty($CFG->allowunenrol)) ? CAP_INHERIT : CAP_ALLOW,
f43ce1ad 560 'teacher' => CAP_ALLOW,
561 'editingteacher' => CAP_ALLOW,
562 'coursecreator' => CAP_ALLOW,
4f0c2d00 563 'manager' => CAP_ALLOW
99f9cb51 564 )
565 ),
eef868d1 566
20dd4cf5 567 'moodle/role:switchroles' => array(
bcdb0f19 568
3a0c6cca 569 'riskbitmask' => RISK_XSS | RISK_PERSONAL,
bcdb0f19 570
20dd4cf5 571 'captype' => 'read',
f432bebf 572 'contextlevel' => CONTEXT_COURSE,
20dd4cf5 573 'legacy' => array(
20dd4cf5 574 'editingteacher' => CAP_ALLOW,
4f0c2d00 575 'manager' => CAP_ALLOW
20dd4cf5 576 )
577 ),
578
8ed5dd63 579 // Create, update and delete course categories. (Deleting a course category
580 // does not let you delete the courses it contains, unless you also have
581 // moodle/course: delete.) Creating and deleting requires this permission in
582 // the parent category.
583 'moodle/category:manage' => array(
eef868d1 584
89a792ab 585 'riskbitmask' => RISK_XSS,
586
bbbf2d40 587 'captype' => 'write',
588 'contextlevel' => CONTEXT_COURSECAT,
589 'legacy' => array(
4f0c2d00 590 'manager' => CAP_ALLOW
8ed5dd63 591 ),
592 'clonepermissionsfrom' => 'moodle/category:update'
bbbf2d40 593 ),
eef868d1 594
8ed5dd63 595 'moodle/category:viewhiddencategories' => array(
eef868d1 596
8ed5dd63 597 'captype' => 'read',
bbbf2d40 598 'contextlevel' => CONTEXT_COURSECAT,
599 'legacy' => array(
8ed5dd63 600 'coursecreator' => CAP_ALLOW,
4f0c2d00 601 'manager' => CAP_ALLOW
8ed5dd63 602 ),
603 'clonepermissionsfrom' => 'moodle/category:visibility'
bbbf2d40 604 ),
eef868d1 605
3f791403
PS
606 // create, delete, move cohorts in system and course categories,
607 // (cohorts with component !== null can be only moved)
608 'moodle/cohort:manage' => array(
609
610 'captype' => 'write',
611 'contextlevel' => CONTEXT_COURSECAT,
612 'legacy' => array(
613 'manager' => CAP_ALLOW
614 )
615 ),
616
617 // add and remove cohort members (only for cohorts where component !== null)
618 'moodle/cohort:assign' => array(
619
620 'captype' => 'write',
621 'contextlevel' => CONTEXT_COURSECAT,
622 'legacy' => array(
623 'manager' => CAP_ALLOW
624 )
625 ),
626
627 // view members of a cohort, this can be used in course context too,
628 // this also controls the ability to actually use cohort
629 'moodle/cohort:view' => array(
630
631 'captype' => 'read',
632 'contextlevel' => CONTEXT_COURSE,
633 'legacy' => array(
634 'editingteacher' => CAP_ALLOW,
635 'manager' => CAP_ALLOW
636 )
637 ),
638
bbbf2d40 639 'moodle/course:create' => array(
eef868d1 640
21b6db6e 641 'riskbitmask' => RISK_XSS,
642
bbbf2d40 643 'captype' => 'write',
5e992f56 644 'contextlevel' => CONTEXT_COURSECAT,
bbbf2d40 645 'legacy' => array(
4473252d 646 'coursecreator' => CAP_ALLOW,
4f0c2d00 647 'manager' => CAP_ALLOW
bbbf2d40 648 )
649 ),
eef868d1 650
e452210a 651 'moodle/course:request' => array(
652 'captype' => 'write',
653 'contextlevel' => CONTEXT_SYSTEM,
654 'legacy' => array(
655 'user' => CAP_ALLOW,
656 )
657 ),
658
bbbf2d40 659 'moodle/course:delete' => array(
eef868d1 660
3a0c6cca 661 'riskbitmask' => RISK_DATALOSS,
662
bbbf2d40 663 'captype' => 'write',
664 'contextlevel' => CONTEXT_COURSE,
665 'legacy' => array(
9136a60c 666 'editingteacher' => CAP_ALLOW,
4f0c2d00 667 'manager' => CAP_ALLOW
bbbf2d40 668 )
669 ),
eef868d1 670
bbbf2d40 671 'moodle/course:update' => array(
eef868d1 672
21b6db6e 673 'riskbitmask' => RISK_XSS,
674
bbbf2d40 675 'captype' => 'write',
676 'contextlevel' => CONTEXT_COURSE,
677 'legacy' => array(
bbbf2d40 678 'editingteacher' => CAP_ALLOW,
4f0c2d00 679 'manager' => CAP_ALLOW
bbbf2d40 680 )
681 ),
eef868d1 682
6fbaf7f8
PS
683 /* originally this capability was called moodle/course:view,
684 * but since 2.0 it is used for access to course without the enrolment
4f0c2d00
PS
685 */
686 'moodle/course:participate' => array(
eef868d1 687
bbbf2d40 688 'captype' => 'read',
689 'contextlevel' => CONTEXT_COURSE,
690 'legacy' => array(
bbbf2d40 691 'student' => CAP_ALLOW,
692 'teacher' => CAP_ALLOW,
72cf2e39 693 'editingteacher' => CAP_ALLOW
bbbf2d40 694 )
695 ),
eef868d1 696
4f0c2d00
PS
697 'moodle/course:view' => array(
698
699 'captype' => 'read',
700 'contextlevel' => CONTEXT_COURSE,
701 'legacy' => array(
702 'manager' => CAP_ALLOW,
703 )
704 ),
705
77c645df 706 'moodle/course:bulkmessaging' => array(
707
708 'riskbitmask' => RISK_SPAM,
709
710 'captype' => 'write',
711 'contextlevel' => CONTEXT_COURSE,
712 'legacy' => array(
77c645df 713 'teacher' => CAP_ALLOW,
714 'editingteacher' => CAP_ALLOW,
4f0c2d00 715 'manager' => CAP_ALLOW
77c645df 716 )
717 ),
718
1c45e42e 719 'moodle/course:viewhiddenuserfields' => array(
eef868d1 720
21b6db6e 721 'riskbitmask' => RISK_PERSONAL,
4e781c7b 722
723 'captype' => 'read',
724 'contextlevel' => CONTEXT_COURSE,
725 'legacy' => array(
726 'teacher' => CAP_ALLOW,
727 'editingteacher' => CAP_ALLOW,
4f0c2d00 728 'manager' => CAP_ALLOW
4e781c7b 729 )
730 ),
731
1c45e42e 732 'moodle/course:viewhiddencourses' => array(
eef868d1 733
1c45e42e 734 'captype' => 'read',
735 'contextlevel' => CONTEXT_COURSE,
736 'legacy' => array(
2f5ab42b 737 'coursecreator' => CAP_ALLOW,
738 'teacher' => CAP_ALLOW,
739 'editingteacher' => CAP_ALLOW,
4f0c2d00 740 'manager' => CAP_ALLOW
1c45e42e 741 )
742 ),
eef868d1 743
bbbf2d40 744 'moodle/course:visibility' => array(
eef868d1 745
bbbf2d40 746 'captype' => 'write',
747 'contextlevel' => CONTEXT_COURSE,
748 'legacy' => array(
4f0c2d00 749 'manager' => CAP_ALLOW
bbbf2d40 750 )
751 ),
eef868d1 752
a028c291 753 'moodle/course:managefiles' => array(
eef868d1 754
21b6db6e 755 'riskbitmask' => RISK_XSS,
756
a028c291 757 'captype' => 'write',
758 'contextlevel' => CONTEXT_COURSE,
759 'legacy' => array(
a028c291 760 'editingteacher' => CAP_ALLOW,
4f0c2d00 761 'manager' => CAP_ALLOW
a028c291 762 )
763 ),
eef868d1 764
bbbf2d40 765 'moodle/course:manageactivities' => array(
eef868d1 766
21b6db6e 767 'riskbitmask' => RISK_XSS,
768
bbbf2d40 769 'captype' => 'write',
770 'contextlevel' => CONTEXT_COURSE,
771 'legacy' => array(
bbbf2d40 772 'editingteacher' => CAP_ALLOW,
4f0c2d00 773 'manager' => CAP_ALLOW
bbbf2d40 774 )
775 ),
eef868d1 776
b79da3ac 777 'moodle/course:managemetacourse' => array(
eef868d1 778
3a0c6cca 779 'riskbitmask' => RISK_XSS | RISK_PERSONAL,
780
4b7aaf40 781 'captype' => 'write',
782 'contextlevel' => CONTEXT_COURSE,
783 'legacy' => array(
4b7aaf40 784 'editingteacher' => CAP_ALLOW,
4f0c2d00 785 'manager' => CAP_ALLOW
4b7aaf40 786 )
787 ),
eef868d1 788
bbbf2d40 789 'moodle/course:activityvisibility' => array(
eef868d1 790
bbbf2d40 791 'captype' => 'write',
792 'contextlevel' => CONTEXT_COURSE,
793 'legacy' => array(
bbbf2d40 794 'editingteacher' => CAP_ALLOW,
4f0c2d00 795 'manager' => CAP_ALLOW
bbbf2d40 796 )
797 ),
eef868d1 798
bbbf2d40 799 'moodle/course:viewhiddenactivities' => array(
eef868d1 800
bbbf2d40 801 'captype' => 'write',
802 'contextlevel' => CONTEXT_COURSE,
803 'legacy' => array(
bbbf2d40 804 'teacher' => CAP_ALLOW,
805 'editingteacher' => CAP_ALLOW,
4f0c2d00 806 'manager' => CAP_ALLOW
bbbf2d40 807 )
808 ),
eef868d1 809
bbbf2d40 810 'moodle/course:viewparticipants' => array(
eef868d1 811
bbbf2d40 812 'captype' => 'read',
813 'contextlevel' => CONTEXT_COURSE,
814 'legacy' => array(
bbbf2d40 815 'student' => CAP_ALLOW,
816 'teacher' => CAP_ALLOW,
817 'editingteacher' => CAP_ALLOW,
4f0c2d00 818 'manager' => CAP_ALLOW
165088f6 819 )
820 ),
f7c0d84b 821
822 'moodle/course:changefullname' => array(
823
cd7f72c0 824 'riskbitmask' => RISK_XSS,
825
f7c0d84b 826 'captype' => 'write',
827 'contextlevel' => CONTEXT_COURSE,
828 'legacy' => array(
829 'editingteacher' => CAP_ALLOW,
4f0c2d00 830 'manager' => CAP_ALLOW
5e99b9d7 831 ),
832 'clonepermissionsfrom' => 'moodle/course:update'
f7c0d84b 833 ),
834
835 'moodle/course:changeshortname' => array(
836
cd7f72c0 837 'riskbitmask' => RISK_XSS,
838
f7c0d84b 839 'captype' => 'write',
840 'contextlevel' => CONTEXT_COURSE,
841 'legacy' => array(
842 'editingteacher' => CAP_ALLOW,
4f0c2d00 843 'manager' => CAP_ALLOW
5e99b9d7 844 ),
845 'clonepermissionsfrom' => 'moodle/course:update'
f7c0d84b 846 ),
847
848 'moodle/course:changeidnumber' => array(
849
cd7f72c0 850 'riskbitmask' => RISK_XSS,
851
f7c0d84b 852 'captype' => 'write',
853 'contextlevel' => CONTEXT_COURSE,
854 'legacy' => array(
855 'editingteacher' => CAP_ALLOW,
4f0c2d00 856 'manager' => CAP_ALLOW
5e99b9d7 857 ),
858 'clonepermissionsfrom' => 'moodle/course:update'
f7c0d84b 859 ),
50569ba3 860 'moodle/course:changecategory' => array(
861 'riskbitmask' => RISK_XSS,
862
863 'captype' => 'write',
864 'contextlevel' => CONTEXT_COURSE,
865 'legacy' => array(
866 'editingteacher' => CAP_ALLOW,
4f0c2d00 867 'manager' => CAP_ALLOW
50569ba3 868 ),
869 'clonepermissionsfrom' => 'moodle/course:update'
870 ),
871
872 'moodle/course:changesummary' => array(
873 'riskbitmask' => RISK_XSS,
874
875 'captype' => 'write',
876 'contextlevel' => CONTEXT_COURSE,
877 'legacy' => array(
878 'editingteacher' => CAP_ALLOW,
4f0c2d00 879 'manager' => CAP_ALLOW
50569ba3 880 ),
881 'clonepermissionsfrom' => 'moodle/course:update'
882 ),
883
f7c0d84b 884
165088f6 885 'moodle/site:viewparticipants' => array(
886
887 'captype' => 'read',
888 'contextlevel' => CONTEXT_SYSTEM,
889 'legacy' => array(
4f0c2d00 890 'manager' => CAP_ALLOW
bbbf2d40 891 )
892 ),
eef868d1 893
bbbf2d40 894 'moodle/course:viewscales' => array(
eef868d1 895
bbbf2d40 896 'captype' => 'read',
897 'contextlevel' => CONTEXT_COURSE,
898 'legacy' => array(
bbbf2d40 899 'student' => CAP_ALLOW,
900 'teacher' => CAP_ALLOW,
901 'editingteacher' => CAP_ALLOW,
4f0c2d00 902 'manager' => CAP_ALLOW
bbbf2d40 903 )
904 ),
eef868d1 905
bbbf2d40 906 'moodle/course:managescales' => array(
eef868d1 907
bbbf2d40 908 'captype' => 'write',
909 'contextlevel' => CONTEXT_COURSE,
910 'legacy' => array(
bbbf2d40 911 'editingteacher' => CAP_ALLOW,
4f0c2d00 912 'manager' => CAP_ALLOW
bbbf2d40 913 )
914 ),
eef868d1 915
bbbf2d40 916 'moodle/course:managegroups' => array(
917
918 'captype' => 'write',
919 'contextlevel' => CONTEXT_COURSE,
a028c291 920 'legacy' => array(
a028c291 921 'editingteacher' => CAP_ALLOW,
4f0c2d00 922 'manager' => CAP_ALLOW
a028c291 923 )
924 ),
eef868d1 925
a028c291 926 'moodle/course:reset' => array(
927
3a0c6cca 928 'riskbitmask' => RISK_DATALOSS,
929
a028c291 930 'captype' => 'write',
931 'contextlevel' => CONTEXT_COURSE,
bbbf2d40 932 'legacy' => array(
bbbf2d40 933 'editingteacher' => CAP_ALLOW,
4f0c2d00 934 'manager' => CAP_ALLOW
bbbf2d40 935 )
936 ),
eef868d1 937
bbbf2d40 938 'moodle/blog:view' => array(
939
940 'captype' => 'read',
05de723b
NC
941 'contextlevel' => CONTEXT_SYSTEM,
942 'legacy' => array(
943 'guest' => CAP_ALLOW,
944 'user' => CAP_ALLOW,
945 'student' => CAP_ALLOW,
946 'teacher' => CAP_ALLOW,
947 'editingteacher' => CAP_ALLOW,
4f0c2d00 948 'manager' => CAP_ALLOW
05de723b
NC
949 )
950 ),
951
952 'moodle/blog:search' => array(
953 'captype' => 'read',
954 'contextlevel' => CONTEXT_SYSTEM,
bbbf2d40 955 'legacy' => array(
00adf177 956 'guest' => CAP_ALLOW,
c785d40a 957 'user' => CAP_ALLOW,
bbbf2d40 958 'student' => CAP_ALLOW,
959 'teacher' => CAP_ALLOW,
960 'editingteacher' => CAP_ALLOW,
4f0c2d00 961 'manager' => CAP_ALLOW
bbbf2d40 962 )
963 ),
eef868d1 964
05de723b
NC
965 'moodle/blog:viewdrafts' => array(
966
967 'riskbitmask' => RISK_PERSONAL,
968 'captype' => 'read',
969 'contextlevel' => CONTEXT_SYSTEM,
970 'legacy' => array(
4f0c2d00 971 'manager' => CAP_ALLOW
05de723b
NC
972 )
973 ),
974
5a8ab2e9 975 'moodle/blog:create' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 976
21b6db6e 977 'riskbitmask' => RISK_SPAM,
978
bbbf2d40 979 'captype' => 'write',
980 'contextlevel' => CONTEXT_SYSTEM,
981 'legacy' => array(
c785d40a 982 'user' => CAP_ALLOW,
4f0c2d00 983 'manager' => CAP_ALLOW
bbbf2d40 984 )
985 ),
eef868d1 986
bbbf2d40 987 'moodle/blog:manageentries' => array(
988
21b6db6e 989 'riskbitmask' => RISK_SPAM,
990
bbbf2d40 991 'captype' => 'write',
05de723b 992 'contextlevel' => CONTEXT_SYSTEM,
bbbf2d40 993 'legacy' => array(
bbbf2d40 994 'teacher' => CAP_ALLOW,
995 'editingteacher' => CAP_ALLOW,
4f0c2d00 996 'manager' => CAP_ALLOW
bbbf2d40 997 )
998 ),
05de723b 999
cae83708 1000 'moodle/blog:manageexternal' => array(
1001
1002 'riskbitmask' => RISK_SPAM,
1003
1004 'captype' => 'write',
1005 'contextlevel' => CONTEXT_USER,
1006 'legacy' => array(
1007 'student' => CAP_ALLOW,
1008 'user' => CAP_ALLOW,
1009 'teacher' => CAP_ALLOW,
1010 'editingteacher' => CAP_ALLOW,
4f0c2d00 1011 'manager' => CAP_ALLOW
cae83708 1012 )
1013 ),
1014
05de723b
NC
1015 'moodle/blog:associatecourse' => array(
1016
1017 'captype' => 'write',
1018 'contextlevel' => CONTEXT_COURSE,
1019 'legacy' => array(
1020 'student' => CAP_ALLOW,
1021 'user' => CAP_ALLOW,
1022 'teacher' => CAP_ALLOW,
1023 'editingteacher' => CAP_ALLOW,
4f0c2d00 1024 'manager' => CAP_ALLOW
05de723b
NC
1025 )
1026 ),
1027
1028 'moodle/blog:associatemodule' => array(
1029
1030 'captype' => 'write',
1031 'contextlevel' => CONTEXT_MODULE,
1032 'legacy' => array(
1033 'student' => CAP_ALLOW,
1034 'user' => CAP_ALLOW,
1035 'teacher' => CAP_ALLOW,
1036 'editingteacher' => CAP_ALLOW,
4f0c2d00 1037 'manager' => CAP_ALLOW
05de723b
NC
1038 )
1039 ),
eef868d1 1040
5a8ab2e9 1041 'moodle/calendar:manageownentries' => array( // works in CONTEXT_SYSTEM only
bbbf2d40 1042
21b6db6e 1043 'riskbitmask' => RISK_SPAM,
1044
bbbf2d40 1045 'captype' => 'write',
f432bebf 1046 'contextlevel' => CONTEXT_COURSE,
bbbf2d40 1047 'legacy' => array(
c785d40a 1048 'user' => CAP_ALLOW,
4f0c2d00 1049 'manager' => CAP_ALLOW
bbbf2d40 1050 )
1051 ),
eef868d1 1052
f63d2922 1053 'moodle/calendar:managegroupentries' => array(
1054
1055 'riskbitmask' => RISK_SPAM,
1056
1057 'captype' => 'write',
f432bebf 1058 'contextlevel' => CONTEXT_COURSE,
f63d2922 1059 'legacy' => array(
1060 'teacher' => CAP_ALLOW,
1061 'editingteacher' => CAP_ALLOW,
4f0c2d00 1062 'manager' => CAP_ALLOW
f63d2922 1063 )
1064 ),
1065
bbbf2d40 1066 'moodle/calendar:manageentries' => array(
1067
21b6db6e 1068 'riskbitmask' => RISK_SPAM,
1069
bbbf2d40 1070 'captype' => 'write',
f432bebf 1071 'contextlevel' => CONTEXT_COURSE,
bbbf2d40 1072 'legacy' => array(
bbbf2d40 1073 'teacher' => CAP_ALLOW,
1074 'editingteacher' => CAP_ALLOW,
4f0c2d00 1075 'manager' => CAP_ALLOW
bbbf2d40 1076 )
77d4953e 1077 ),
a044c05d 1078
1079 'moodle/user:editprofile' => array(
1080
3a0c6cca 1081 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
a044c05d 1082
1083 'captype' => 'write',
1084 'contextlevel' => CONTEXT_USER,
1085 'legacy' => array(
4f0c2d00 1086 'manager' => CAP_ALLOW
a044c05d 1087 )
1088 ),
eef868d1 1089
a5b8be62 1090 'moodle/user:editownprofile' => array(
1cb3da36 1091
3a0c6cca 1092 'riskbitmask' => RISK_SPAM,
1093
a5b8be62 1094 'captype' => 'write',
1095 'contextlevel' => CONTEXT_SYSTEM,
1096 'legacy' => array(
1cb3da36 1097 'guest' => CAP_PROHIBIT,
1098 'user' => CAP_ALLOW,
4f0c2d00 1099 'manager' => CAP_ALLOW
a5b8be62 1100 )
1cb3da36 1101 ),
1102
a5b8be62 1103 'moodle/user:changeownpassword' => array(
1cb3da36 1104
a5b8be62 1105 'captype' => 'write',
1106 'contextlevel' => CONTEXT_SYSTEM,
1107 'legacy' => array(
1cb3da36 1108 'guest' => CAP_PROHIBIT,
1109 'user' => CAP_ALLOW,
4f0c2d00 1110 'manager' => CAP_ALLOW
a5b8be62 1111 )
1cb3da36 1112 ),
1113
eef868d1 1114 // The next 3 might make no sense for some roles, e.g teacher, etc.
77d4953e 1115 // since the next level up is site. These are more for the parent role
1116 'moodle/user:readuserposts' => array(
bcdb0f19 1117
77d4953e 1118 'captype' => 'read',
4b10f08b 1119 'contextlevel' => CONTEXT_USER,
77d4953e 1120 'legacy' => array(
77d4953e 1121 'student' => CAP_ALLOW,
1122 'teacher' => CAP_ALLOW,
1123 'editingteacher' => CAP_ALLOW,
4f0c2d00 1124 'manager' => CAP_ALLOW
77d4953e 1125 )
1126 ),
eef868d1 1127
77d4953e 1128 'moodle/user:readuserblogs' => array(
bcdb0f19 1129
77d4953e 1130 'captype' => 'read',
4b10f08b 1131 'contextlevel' => CONTEXT_USER,
77d4953e 1132 'legacy' => array(
77d4953e 1133 'student' => CAP_ALLOW,
1134 'teacher' => CAP_ALLOW,
1135 'editingteacher' => CAP_ALLOW,
4f0c2d00 1136 'manager' => CAP_ALLOW
77d4953e 1137 )
1138 ),
eef868d1 1139
3c7da16d 1140 // designed for parent role - not used in legacy roles
77d4953e 1141 'moodle/user:viewuseractivitiesreport' => array(
3c7da16d 1142 'riskbitmask' => RISK_PERSONAL,
bcdb0f19 1143
77d4953e 1144 'captype' => 'read',
4b10f08b 1145 'contextlevel' => CONTEXT_USER,
77d4953e 1146 'legacy' => array(
77d4953e 1147 )
945f88ca 1148 ),
4e781c7b 1149
3b120e46 1150 //capabilities designed for the new message system configuration
1151 'moodle/user:editmessageprofile' => array(
f7c0d84b 1152
3b120e46 1153 'riskbitmask' => RISK_SPAM,
f7c0d84b 1154
3b120e46 1155 'captype' => 'write',
1156 'contextlevel' => CONTEXT_USER,
1157 'legacy' => array(
4f0c2d00 1158 'manager' => CAP_ALLOW
3b120e46 1159 )
1160 ),
f7c0d84b 1161
1162 'moodle/user:editownmessageprofile' => array(
1163
1164 'captype' => 'write',
1165 'contextlevel' => CONTEXT_SYSTEM,
1166 'legacy' => array(
3b120e46 1167 'guest' => CAP_PROHIBIT,
1168 'user' => CAP_ALLOW,
4f0c2d00 1169 'manager' => CAP_ALLOW
f7c0d84b 1170 )
3b120e46 1171 ),
eef868d1 1172
271e6dec 1173 'moodle/question:managecategory' => array(
14d701d6 1174 'riskbitmask' => RISK_SPAM | RISK_XSS,
945f88ca 1175 'captype' => 'write',
1176 'contextlevel' => CONTEXT_COURSE,
1177 'legacy' => array(
945f88ca 1178 'editingteacher' => CAP_ALLOW,
4f0c2d00 1179 'manager' => CAP_ALLOW
945f88ca 1180 )
a5b8be62 1181 ),
1182
271e6dec 1183 //new in moodle 1.9
1184 'moodle/question:add' => array(
14d701d6 1185 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1186 'captype' => 'write',
1187 'contextlevel' => CONTEXT_COURSE,
1188 'legacy' => array(
1189 'editingteacher' => CAP_ALLOW,
4f0c2d00 1190 'manager' => CAP_ALLOW
271e6dec 1191 ),
1192 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1193 ),
271e6dec 1194 'moodle/question:editmine' => array(
14d701d6 1195 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1196 'captype' => 'write',
1197 'contextlevel' => CONTEXT_COURSE,
1198 'legacy' => array(
1199 'editingteacher' => CAP_ALLOW,
4f0c2d00 1200 'manager' => CAP_ALLOW
271e6dec 1201 ),
a5b8be62 1202 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1203 ),
1204 'moodle/question:editall' => array(
14d701d6 1205 'riskbitmask' => RISK_SPAM | RISK_XSS,
271e6dec 1206 'captype' => 'write',
1207 'contextlevel' => CONTEXT_COURSE,
1208 'legacy' => array(
1209 'editingteacher' => CAP_ALLOW,
4f0c2d00 1210 'manager' => CAP_ALLOW
271e6dec 1211 ),
a5b8be62 1212 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1213 ),
1214 'moodle/question:viewmine' => array(
945f88ca 1215 'captype' => 'read',
1216 'contextlevel' => CONTEXT_COURSE,
1217 'legacy' => array(
945f88ca 1218 'editingteacher' => CAP_ALLOW,
4f0c2d00 1219 'manager' => CAP_ALLOW
271e6dec 1220 ),
a5b8be62 1221 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1222 ),
271e6dec 1223 'moodle/question:viewall' => array(
1224 'captype' => 'read',
1225 'contextlevel' => CONTEXT_COURSE,
1226 'legacy' => array(
1227 'editingteacher' => CAP_ALLOW,
4f0c2d00 1228 'manager' => CAP_ALLOW
271e6dec 1229 ),
a5b8be62 1230 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1231 ),
1232 'moodle/question:usemine' => array(
1233 'captype' => 'read',
1234 'contextlevel' => CONTEXT_COURSE,
1235 'legacy' => array(
1236 'editingteacher' => CAP_ALLOW,
4f0c2d00 1237 'manager' => CAP_ALLOW
271e6dec 1238 ),
a5b8be62 1239 'clonepermissionsfrom' => 'moodle/question:manage'
271e6dec 1240 ),
1241 'moodle/question:useall' => array(
1242 'captype' => 'read',
1243 'contextlevel' => CONTEXT_COURSE,
1244 'legacy' => array(
1245 'editingteacher' => CAP_ALLOW,
4f0c2d00 1246 'manager' => CAP_ALLOW
271e6dec 1247 ),
a5b8be62 1248 'clonepermissionsfrom' => 'moodle/question:manage'
1249 ),
271e6dec 1250 'moodle/question:movemine' => array(
945f88ca 1251 'captype' => 'write',
1252 'contextlevel' => CONTEXT_COURSE,
1253 'legacy' => array(
945f88ca 1254 'editingteacher' => CAP_ALLOW,
4f0c2d00 1255 'manager' => CAP_ALLOW
271e6dec 1256 ),
a5b8be62 1257 'clonepermissionsfrom' => 'moodle/question:manage'
945f88ca 1258 ),
271e6dec 1259 'moodle/question:moveall' => array(
945f88ca 1260 'captype' => 'write',
1261 'contextlevel' => CONTEXT_COURSE,
1262 'legacy' => array(
945f88ca 1263 'editingteacher' => CAP_ALLOW,
4f0c2d00 1264 'manager' => CAP_ALLOW
271e6dec 1265 ),
a5b8be62 1266 'clonepermissionsfrom' => 'moodle/question:manage'
7191a1fa 1267 ),
271e6dec 1268 //END new in moodle 1.9
a5b8be62 1269
0eb6b04a 1270 // Configure the installed question types.
1271 'moodle/question:config' => array(
0eb6b04a 1272 'riskbitmask' => RISK_CONFIG,
0eb6b04a 1273 'captype' => 'write',
1274 'contextlevel' => CONTEXT_SYSTEM,
1275 'legacy' => array(
4f0c2d00 1276 'manager' => CAP_ALLOW
0eb6b04a 1277 )
1278 ),
1279
62e76c67 1280 // While attempting questions, the ability to flag particular questions for later reference.
1281 'moodle/question:flag' => array(
1282 'captype' => 'write',
1283 'contextlevel' => CONTEXT_COURSE,
1284 'legacy' => array(
1285 'student' => CAP_ALLOW,
1286 'teacher' => CAP_ALLOW,
1287 'editingteacher' => CAP_ALLOW,
1288 'coursecreator' => CAP_ALLOW,
4f0c2d00 1289 'manager' => CAP_ALLOW
62e76c67 1290 )
1291 ),
bcdb0f19 1292
62e76c67 1293 'moodle/site:doclinks' => array(
7191a1fa 1294 'captype' => 'read',
1295 'contextlevel' => CONTEXT_SYSTEM,
1296 'legacy' => array(
7191a1fa 1297 'teacher' => CAP_ALLOW,
1298 'editingteacher' => CAP_ALLOW,
4f0c2d00 1299 'manager' => CAP_ALLOW
7191a1fa 1300 )
3924b988 1301 ),
eef868d1 1302
3924b988 1303 'moodle/course:sectionvisibility' => array(
bcdb0f19 1304
3924b988 1305 'captype' => 'write',
1306 'contextlevel' => CONTEXT_COURSE,
1307 'legacy' => array(
3924b988 1308 'editingteacher' => CAP_ALLOW,
4f0c2d00 1309 'manager' => CAP_ALLOW
3924b988 1310 )
1311 ),
eef868d1 1312
dc558690 1313 'moodle/course:useremail' => array(
bcdb0f19 1314
dc558690 1315 'captype' => 'write',
1316 'contextlevel' => CONTEXT_COURSE,
1317 'legacy' => array(
dc558690 1318 'editingteacher' => CAP_ALLOW,
4f0c2d00 1319 'manager' => CAP_ALLOW
dc558690 1320 )
1321 ),
eef868d1 1322
3924b988 1323 'moodle/course:viewhiddensections' => array(
bcdb0f19 1324
3924b988 1325 'captype' => 'write',
1326 'contextlevel' => CONTEXT_COURSE,
1327 'legacy' => array(
3924b988 1328 'editingteacher' => CAP_ALLOW,
4f0c2d00 1329 'manager' => CAP_ALLOW
3924b988 1330 )
1331 ),
eef868d1 1332
3924b988 1333 'moodle/course:setcurrentsection' => array(
bcdb0f19 1334
3924b988 1335 'captype' => 'write',
1336 'contextlevel' => CONTEXT_COURSE,
1337 'legacy' => array(
3924b988 1338 'editingteacher' => CAP_ALLOW,
4f0c2d00 1339 'manager' => CAP_ALLOW
3924b988 1340 )
1341 ),
eef868d1 1342
dd45888a 1343 'moodle/site:mnetlogintoremote' => array(
bc4c9800 1344
3924b988 1345 'captype' => 'read',
dd45888a 1346 'contextlevel' => CONTEXT_SYSTEM,
3924b988 1347 'legacy' => array(
3924b988 1348 )
1349 ),
eef868d1 1350
dd45888a 1351 'moodle/grade:viewall' => array(
bcdb0f19 1352 'riskbitmask' => RISK_PERSONAL,
dd45888a 1353 'captype' => 'read',
eecf76df 1354 'contextlevel' => CONTEXT_COURSE, // and CONTEXT_USER
3924b988 1355 'legacy' => array(
dd45888a 1356 'teacher' => CAP_ALLOW,
3924b988 1357 'editingteacher' => CAP_ALLOW,
4f0c2d00 1358 'manager' => CAP_ALLOW
dd45888a 1359 ),
1360 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
f509ce06 1361 ),
f43ce1ad 1362
dd45888a 1363 'moodle/grade:view' => array(
f509ce06 1364 'captype' => 'read',
eecf76df 1365 'contextlevel' => CONTEXT_COURSE,
f509ce06 1366 'legacy' => array(
dd45888a 1367 'student' => CAP_ALLOW
f509ce06 1368 )
ca9ffa18 1369 ),
dd45888a 1370
1371 'moodle/grade:viewhidden' => array(
ca9ffa18 1372 'riskbitmask' => RISK_PERSONAL,
1373 'captype' => 'read',
eecf76df 1374 'contextlevel' => CONTEXT_COURSE,
ca9ffa18 1375 'legacy' => array(
0371f8e5 1376 'teacher' => CAP_ALLOW,
1377 'editingteacher' => CAP_ALLOW,
4f0c2d00 1378 'manager' => CAP_ALLOW
dd45888a 1379 ),
1380 'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
ca9ffa18 1381 ),
dd45888a 1382
1383 'moodle/grade:import' => array(
3a0c6cca 1384 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
dd45888a 1385 'captype' => 'write',
ca9ffa18 1386 'contextlevel' => CONTEXT_COURSE,
1387 'legacy' => array(
ca9ffa18 1388 'editingteacher' => CAP_ALLOW,
4f0c2d00 1389 'manager' => CAP_ALLOW
dd45888a 1390 ),
1391 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1392 ),
dd45888a 1393
1394 'moodle/grade:export' => array(
ca9ffa18 1395 'riskbitmask' => RISK_PERSONAL,
1396 'captype' => 'read',
1397 'contextlevel' => CONTEXT_COURSE,
1398 'legacy' => array(
1399 'teacher' => CAP_ALLOW,
1400 'editingteacher' => CAP_ALLOW,
4f0c2d00 1401 'manager' => CAP_ALLOW
dd45888a 1402 ),
1403 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1404 ),
dd45888a 1405
1406 'moodle/grade:manage' => array(
3a0c6cca 1407 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
dd45888a 1408 'captype' => 'write',
1409 'contextlevel' => CONTEXT_COURSE,
ca9ffa18 1410 'legacy' => array(
dd45888a 1411 'editingteacher' => CAP_ALLOW,
4f0c2d00 1412 'manager' => CAP_ALLOW
dd45888a 1413 ),
1414 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1415 ),
dd45888a 1416
a5b8be62 1417 'moodle/grade:edit' => array(
1418 'riskbitmask' => RISK_PERSONAL | RISK_XSS,
04259694 1419 'captype' => 'write',
1420 'contextlevel' => CONTEXT_COURSE,
1421 'legacy' => array(
1422 'editingteacher' => CAP_ALLOW,
4f0c2d00 1423 'manager' => CAP_ALLOW
04259694 1424 ),
1425 'clonepermissionsfrom' => 'moodle/course:managegrades'
1426 ),
1427
a5b8be62 1428 'moodle/grade:manageoutcomes' => array(
284abb09 1429 'captype' => 'write',
1430 'contextlevel' => CONTEXT_COURSE,
1431 'legacy' => array(
1432 'editingteacher' => CAP_ALLOW,
4f0c2d00 1433 'manager' => CAP_ALLOW
284abb09 1434 ),
1435 'clonepermissionsfrom' => 'moodle/course:managegrades'
1436 ),
1437
1438 'moodle/grade:manageletters' => array(
ca9ffa18 1439 'captype' => 'write',
1440 'contextlevel' => CONTEXT_COURSE,
1441 'legacy' => array(
1442 'editingteacher' => CAP_ALLOW,
4f0c2d00 1443 'manager' => CAP_ALLOW
a5b8be62 1444 ),
1445 'clonepermissionsfrom' => 'moodle/course:managegrades'
ca9ffa18 1446 ),
dd45888a 1447
a5b8be62 1448 'moodle/grade:hide' => array(
ca9ffa18 1449 'captype' => 'write',
1450 'contextlevel' => CONTEXT_COURSE,
1451 'legacy' => array(
1452 'editingteacher' => CAP_ALLOW,
4f0c2d00 1453 'manager' => CAP_ALLOW
ca9ffa18 1454 )
1455 ),
dd45888a 1456
a5b8be62 1457 'moodle/grade:lock' => array(
dd45888a 1458 'captype' => 'write',
ca9ffa18 1459 'contextlevel' => CONTEXT_COURSE,
1460 'legacy' => array(
1461 'editingteacher' => CAP_ALLOW,
4f0c2d00 1462 'manager' => CAP_ALLOW
ca9ffa18 1463 )
1464 ),
dd45888a 1465
a5b8be62 1466 'moodle/grade:unlock' => array(
ca9ffa18 1467 'captype' => 'write',
1468 'contextlevel' => CONTEXT_COURSE,
1469 'legacy' => array(
1470 'editingteacher' => CAP_ALLOW,
4f0c2d00 1471 'manager' => CAP_ALLOW
ca9ffa18 1472 )
282c1695 1473 ),
dd45888a 1474
1475 'moodle/my:manageblocks' => array(
282c1695 1476 'captype' => 'write',
1477 'contextlevel' => CONTEXT_SYSTEM,
1478 'legacy' => array(
1479 'user' => CAP_ALLOW
1480 )
eca3af25 1481 ),
dd45888a 1482
eca3af25 1483 'moodle/notes:view' => array(
1484 'captype' => 'read',
f432bebf 1485 'contextlevel' => CONTEXT_COURSE,
eca3af25 1486 'legacy' => array(
1487 'teacher' => CAP_ALLOW,
1488 'editingteacher' => CAP_ALLOW,
4f0c2d00 1489 'manager' => CAP_ALLOW
eca3af25 1490 )
1491 ),
1492
1493 'moodle/notes:manage' => array(
3a0c6cca 1494 'riskbitmask' => RISK_SPAM,
1495
eca3af25 1496 'captype' => 'write',
f432bebf 1497 'contextlevel' => CONTEXT_COURSE,
eca3af25 1498 'legacy' => array(
1499 'teacher' => CAP_ALLOW,
1500 'editingteacher' => CAP_ALLOW,
4f0c2d00 1501 'manager' => CAP_ALLOW
eca3af25 1502 )
dd45888a 1503 ),
79642064 1504
1505 'moodle/tag:manage' => array(
3a0c6cca 1506 'riskbitmask' => RISK_SPAM,
1507
79642064 1508 'captype' => 'write',
1509 'contextlevel' => CONTEXT_SYSTEM,
1510 'legacy' => array(
1511 'teacher' => CAP_ALLOW,
1512 'editingteacher' => CAP_ALLOW,
4f0c2d00 1513 'manager' => CAP_ALLOW
79642064 1514 )
705789bd 1515 ),
1516
1517 'moodle/tag:create' => array(
3a0c6cca 1518 'riskbitmask' => RISK_SPAM,
1519
705789bd 1520 'captype' => 'write',
1521 'contextlevel' => CONTEXT_SYSTEM,
1522 'legacy' => array(
4f0c2d00 1523 'manager' => CAP_ALLOW,
0f07c40e 1524 'user' => CAP_ALLOW
705789bd 1525 )
1526 ),
a5b8be62 1527
705789bd 1528 'moodle/tag:edit' => array(
3a0c6cca 1529 'riskbitmask' => RISK_SPAM,
1530
705789bd 1531 'captype' => 'write',
1532 'contextlevel' => CONTEXT_SYSTEM,
1533 'legacy' => array(
4f0c2d00 1534 'manager' => CAP_ALLOW,
3e6e529f 1535 'user' => CAP_ALLOW
98b5789d 1536 )
1537 ),
a5b8be62 1538
98b5789d 1539 'moodle/tag:editblocks' => array(
1540 'captype' => 'write',
1541 'contextlevel' => CONTEXT_SYSTEM,
1542 'legacy' => array(
705789bd 1543 'teacher' => CAP_ALLOW,
1544 'editingteacher' => CAP_ALLOW,
4f0c2d00 1545 'manager' => CAP_ALLOW
705789bd 1546 )
7e874772 1547 ),
1548
1549 'moodle/block:view' => array(
1550 'captype' => 'read',
1551 'contextlevel' => CONTEXT_BLOCK,
1552 'legacy' => array(
1553 'guest' => CAP_ALLOW,
25a7d980 1554 'user' => CAP_ALLOW,
1555 'student' => CAP_ALLOW,
1556 'teacher' => CAP_ALLOW,
1557 'editingteacher' => CAP_ALLOW,
1558 'coursecreator' => CAP_ALLOW
7e874772 1559 )
8512f577 1560 ),
1561
d14edf06 1562 'moodle/block:edit' => array(
1563 'riskbitmask' => RISK_SPAM | RISK_XSS,
1564
1565 'captype' => 'write',
1566 'contextlevel' => CONTEXT_BLOCK,
1567 'legacy' => array(
1568 'editingteacher' => CAP_ALLOW,
1569 'coursecreator' => CAP_ALLOW
1570 )
1571 ),
1572
8512f577 1573 'moodle/portfolio:export' => array(
1574 'captype' => 'read',
1575 'contextlevel' => CONTEXT_SYSTEM,
1576 'legacy' => array(
1577 'user' => CAP_ALLOW,
1578 'student' => CAP_ALLOW,
1579 'teacher' => CAP_ALLOW,
1580 'editingteacher' => CAP_ALLOW,
1581 'coursecreator' => CAP_ALLOW
1582 )
1bcb7eb5 1583 ),
1584 'moodle/comment:view' => array(
1585
1586 'captype' => 'read',
1587 'contextlevel' => CONTEXT_SYSTEM,
1588 'legacy' => array(
1589 'user' => CAP_ALLOW,
1590 'student' => CAP_ALLOW,
1591 'teacher' => CAP_ALLOW,
1592 'editingteacher' => CAP_ALLOW,
1593 'coursecreator' => CAP_ALLOW,
4f0c2d00 1594 'manager' => CAP_ALLOW
1bcb7eb5 1595 )
1596 ),
1597 'moodle/comment:post' => array(
1598
1599 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
1600 'captype' => 'write',
1601 'contextlevel' => CONTEXT_SYSTEM,
1602 'legacy' => array(
1603 'user' => CAP_ALLOW,
1604 'student' => CAP_ALLOW,
1605 'teacher' => CAP_ALLOW,
1606 'editingteacher' => CAP_ALLOW,
1607 'coursecreator' => CAP_ALLOW,
4f0c2d00 1608 'manager' => CAP_ALLOW
1bcb7eb5 1609 )
1610 ),
1611 'moodle/comment:delete' => array(
1612
1613 'riskbitmask' => RISK_DATALOSS,
1614 'captype' => 'write',
1615 'contextlevel' => CONTEXT_SYSTEM,
1616 'legacy' => array(
1617 'editingteacher' => CAP_ALLOW,
1618 'coursecreator' => CAP_ALLOW,
4f0c2d00 1619 'manager' => CAP_ALLOW
1bcb7eb5 1620 )
5eacbd4b 1621 ),
1622 'moodle/webservice:createtoken' => array(
1623
52dd27bf 1624 'riskbitmask' => RISK_CONFIG | RISK_DATALOSS | RISK_SPAM | RISK_PERSONAL | RISK_XSS,
5eacbd4b 1625 'captype' => 'write',
1626 'contextlevel' => CONTEXT_SYSTEM,
1627 'legacy' => array(
4f0c2d00 1628 'manager' => CAP_ALLOW
5eacbd4b 1629 )
a09aeee4 1630 ),
19fae119 1631 'moodle/rating:view' => array(
a09aeee4
AD
1632 'captype' => 'read',
1633 'contextlevel' => CONTEXT_SYSTEM,
1634 'legacy' => array(
e116a818
AD
1635 'student' => CAP_ALLOW,
1636 'teacher' => CAP_ALLOW,
1637 'editingteacher' => CAP_ALLOW,
4f0c2d00 1638 'manager' => CAP_ALLOW
a09aeee4
AD
1639 )
1640 ),
6595a568
MD
1641 'moodle/rating:viewany' => array(
1642 'riskbitmask' => RISK_PERSONAL,
1643 'captype' => 'read',
1644 'contextlevel' => CONTEXT_SYSTEM,
1645 'legacy' => array(
1646 'student' => CAP_ALLOW,
1647 'teacher' => CAP_ALLOW,
1648 'editingteacher' => CAP_ALLOW,
1649 'manager' => CAP_ALLOW
1650 )
1651 ),
19fae119 1652 'moodle/rating:viewall' => array(
a09aeee4
AD
1653 'riskbitmask' => RISK_PERSONAL,
1654 'captype' => 'read',
1655 'contextlevel' => CONTEXT_SYSTEM,
1656 'legacy' => array(
6595a568 1657 'student' => CAP_ALLOW,
e116a818
AD
1658 'teacher' => CAP_ALLOW,
1659 'editingteacher' => CAP_ALLOW,
4f0c2d00 1660 'manager' => CAP_ALLOW
a09aeee4
AD
1661 )
1662 ),
19fae119 1663 'moodle/rating:rate' => array(
a09aeee4
AD
1664 'captype' => 'write',
1665 'contextlevel' => CONTEXT_SYSTEM,
1666 'legacy' => array(
6595a568 1667 'student' => CAP_ALLOW,
e116a818
AD
1668 'teacher' => CAP_ALLOW,
1669 'editingteacher' => CAP_ALLOW,
4f0c2d00 1670 'manager' => CAP_ALLOW
a09aeee4 1671 )
07ab0c80 1672 ),
1673 'moodle/course:publish' => array(
1674
1675 'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
1676
1677 'captype' => 'write',
1678 'contextlevel' => CONTEXT_SYSTEM,
1679 'legacy' => array(
1680 'manager' => CAP_ALLOW
1681 )
2be4d090
MD
1682 ),
1683 'moodle/course:markcomplete' => array(
1684 'captype' => 'write',
1685 'contextlevel' => CONTEXT_COURSE,
1686 'legacy' => array(
1687 'teacher' => CAP_ALLOW,
1688 'editingteacher' => CAP_ALLOW,
1689 'coursecreator' => CAP_ALLOW,
1690 'manager' => CAP_ALLOW
1691 )
79642064 1692 )
bbbf2d40 1693);