MDL-11082 Improved groups upgrade performance 1.8x -> 1.9; thanks Eloy for telling...
[moodle-pu.git] / mod / data / db / access.php
blob71444b3e61b479d2503ce8989d4cfe787d91e044
1 <?php
2 //
3 // Capability definitions for the data module.
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).
13 // CAPABILITY NAMING CONVENTION
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:
17 // [mod/block]/<component_name>:<capabilityname>
19 // component_name should be the same as the directory name of the mod or block.
21 // Core moodle capabilities are defined thus:
22 // moodle/<capabilityclass>:<capabilityname>
24 // Examples: mod/forum:viewpost
25 // block/recent_activity:view
26 // moodle/site:deleteuser
28 // The variable name for the capability definitions array follows the format
29 // $<componenttype>_<component_name>_capabilities
31 // For the core capabilities, the variable is $moodle_capabilities.
34 $mod_data_capabilities = array(
36 'mod/data:viewentry' => array(
38 'captype' => 'read',
39 'contextlevel' => CONTEXT_MODULE,
40 'legacy' => array(
41 'guest' => CAP_ALLOW,
42 'student' => CAP_ALLOW,
43 'teacher' => CAP_ALLOW,
44 'editingteacher' => CAP_ALLOW,
45 'admin' => CAP_ALLOW
49 'mod/data:writeentry' => array(
51 'riskbitmask' => RISK_SPAM,
53 'captype' => 'write',
54 'contextlevel' => CONTEXT_MODULE,
55 'legacy' => array(
56 'student' => CAP_ALLOW,
57 'teacher' => CAP_ALLOW,
58 'editingteacher' => CAP_ALLOW,
59 'admin' => CAP_ALLOW
63 'mod/data:comment' => array(
65 'riskbitmask' => RISK_SPAM,
67 'captype' => 'write',
68 'contextlevel' => CONTEXT_MODULE,
69 'legacy' => array(
70 'student' => CAP_ALLOW,
71 'teacher' => CAP_ALLOW,
72 'editingteacher' => CAP_ALLOW,
73 'admin' => CAP_ALLOW
77 'mod/data:viewrating' => array(
79 'captype' => 'read',
80 'contextlevel' => CONTEXT_MODULE,
81 'legacy' => array(
82 'teacher' => CAP_ALLOW,
83 'editingteacher' => CAP_ALLOW,
84 'admin' => CAP_ALLOW
88 'mod/data:rate' => array(
90 'captype' => 'write',
91 'contextlevel' => CONTEXT_MODULE,
92 'legacy' => array(
93 'teacher' => CAP_ALLOW,
94 'editingteacher' => CAP_ALLOW,
95 'admin' => CAP_ALLOW
99 'mod/data:approve' => array(
101 'captype' => 'write',
102 'contextlevel' => CONTEXT_MODULE,
103 'legacy' => array(
104 'teacher' => CAP_ALLOW,
105 'editingteacher' => CAP_ALLOW,
106 'admin' => CAP_ALLOW
110 'mod/data:manageentries' => array(
112 'riskbitmask' => RISK_SPAM,
114 'captype' => 'write',
115 'contextlevel' => CONTEXT_MODULE,
116 'legacy' => array(
117 'teacher' => CAP_ALLOW,
118 'editingteacher' => CAP_ALLOW,
119 'admin' => CAP_ALLOW
123 'mod/data:managecomments' => array(
125 'riskbitmask' => RISK_SPAM,
127 'captype' => 'write',
128 'contextlevel' => CONTEXT_MODULE,
129 'legacy' => array(
130 'teacher' => CAP_ALLOW,
131 'editingteacher' => CAP_ALLOW,
132 'admin' => CAP_ALLOW
136 'mod/data:managetemplates' => array(
138 'riskbitmask' => RISK_SPAM | RISK_XSS,
140 'captype' => 'write',
141 'contextlevel' => CONTEXT_MODULE,
142 'legacy' => array(
143 'editingteacher' => CAP_ALLOW,
144 'admin' => CAP_ALLOW
148 'mod/data:viewalluserpresets' => array(
150 'captype' => 'read',
151 'contextlevel' => CONTEXT_MODULE,
152 'legacy' => array(
153 'teacher' => CAP_ALLOW,
154 'editingteacher' => CAP_ALLOW,
155 'admin' => CAP_ALLOW
159 'mod/data:manageuserpresets' => array(
161 'riskbitmask' => RISK_SPAM | RISK_XSS,
163 'captype' => 'write',
164 'contextlevel' => CONTEXT_MODULE,
165 'legacy' => array(
166 'admin' => CAP_ALLOW