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