Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / mod / forum / db / access.php
blob961704a77e219e7d625325ce425ad265a81d8123
1 <?php
2 //
3 // Capability definitions for the forum 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_forum_capabilities = array(
36 'mod/forum:viewdiscussion' => 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/forum:viewhiddentimedposts' => array(
51 'captype' => 'read',
52 'contextlevel' => CONTEXT_MODULE,
53 'legacy' => array(
54 'teacher' => CAP_ALLOW,
55 'editingteacher' => CAP_ALLOW,
56 'admin' => CAP_ALLOW
60 'mod/forum:startdiscussion' => array(
62 'riskbitmask' => RISK_SPAM,
64 'captype' => 'write',
65 'contextlevel' => CONTEXT_MODULE,
66 'legacy' => array(
67 'student' => CAP_ALLOW,
68 'teacher' => CAP_ALLOW,
69 'editingteacher' => CAP_ALLOW,
70 'admin' => CAP_ALLOW
74 'mod/forum:replypost' => array(
76 'riskbitmask' => RISK_SPAM,
78 'captype' => 'write',
79 'contextlevel' => CONTEXT_MODULE,
80 'legacy' => array(
81 'student' => CAP_ALLOW,
82 'teacher' => CAP_ALLOW,
83 'editingteacher' => CAP_ALLOW,
84 'admin' => CAP_ALLOW
88 'mod/forum:addnews' => array(
90 'riskbitmask' => RISK_SPAM,
92 'captype' => 'write',
93 'contextlevel' => CONTEXT_MODULE,
94 'legacy' => array(
95 'teacher' => CAP_ALLOW,
96 'editingteacher' => CAP_ALLOW,
97 'admin' => CAP_ALLOW
101 'mod/forum:replynews' => array(
103 'riskbitmask' => RISK_SPAM,
105 'captype' => 'write',
106 'contextlevel' => CONTEXT_MODULE,
107 'legacy' => array(
108 'teacher' => CAP_ALLOW,
109 'editingteacher' => CAP_ALLOW,
110 'admin' => CAP_ALLOW
114 'mod/forum:viewrating' => array(
116 'captype' => 'read',
117 'contextlevel' => CONTEXT_MODULE,
118 'legacy' => array(
119 'student' => CAP_ALLOW,
120 'teacher' => CAP_ALLOW,
121 'editingteacher' => CAP_ALLOW,
122 'admin' => CAP_ALLOW
126 'mod/forum:viewanyrating' => array(
128 'captype' => 'read',
129 'contextlevel' => CONTEXT_MODULE,
130 'legacy' => array(
131 'teacher' => CAP_ALLOW,
132 'editingteacher' => CAP_ALLOW,
133 'admin' => CAP_ALLOW
137 'mod/forum:rate' => array(
139 'captype' => 'write',
140 'contextlevel' => CONTEXT_MODULE,
141 'legacy' => array(
142 'teacher' => CAP_ALLOW,
143 'editingteacher' => CAP_ALLOW,
144 'admin' => CAP_ALLOW
148 'mod/forum:createattachment' => array(
150 'riskbitmask' => RISK_SPAM,
152 'captype' => 'write',
153 'contextlevel' => CONTEXT_MODULE,
154 'legacy' => array(
155 'student' => CAP_ALLOW,
156 'teacher' => CAP_ALLOW,
157 'editingteacher' => CAP_ALLOW,
158 'admin' => CAP_ALLOW
162 'mod/forum:deleteownpost' => array(
164 'captype' => 'read',
165 'contextlevel' => CONTEXT_MODULE,
166 'legacy' => array(
167 'student' => CAP_ALLOW,
168 'teacher' => CAP_ALLOW,
169 'editingteacher' => CAP_ALLOW,
170 'admin' => CAP_ALLOW
174 'mod/forum:deleteanypost' => array(
176 'captype' => 'read',
177 'contextlevel' => CONTEXT_MODULE,
178 'legacy' => array(
179 'teacher' => CAP_ALLOW,
180 'editingteacher' => CAP_ALLOW,
181 'admin' => CAP_ALLOW
185 'mod/forum:splitdiscussions' => array(
187 'captype' => 'read',
188 'contextlevel' => CONTEXT_MODULE,
189 'legacy' => array(
190 'teacher' => CAP_ALLOW,
191 'editingteacher' => CAP_ALLOW,
192 'admin' => CAP_ALLOW
196 'mod/forum:movediscussions' => array(
198 'captype' => 'read',
199 'contextlevel' => CONTEXT_MODULE,
200 'legacy' => array(
201 'teacher' => CAP_ALLOW,
202 'editingteacher' => CAP_ALLOW,
203 'admin' => CAP_ALLOW
207 'mod/forum:editanypost' => array(
209 'riskbitmask' => RISK_SPAM,
211 'captype' => 'write',
212 'contextlevel' => CONTEXT_MODULE,
213 'legacy' => array(
214 'teacher' => CAP_ALLOW,
215 'editingteacher' => CAP_ALLOW,
216 'admin' => CAP_ALLOW
220 'mod/forum:viewqandawithoutposting' => array(
222 'captype' => 'read',
223 'contextlevel' => CONTEXT_MODULE,
224 'legacy' => array(
225 'teacher' => CAP_ALLOW,
226 'editingteacher' => CAP_ALLOW,
227 'admin' => CAP_ALLOW
231 'mod/forum:viewsubscribers' => array(
233 'captype' => 'read',
234 'contextlevel' => CONTEXT_MODULE,
235 'legacy' => array(
236 'teacher' => CAP_ALLOW,
237 'editingteacher' => CAP_ALLOW,
238 'admin' => CAP_ALLOW
242 'mod/forum:managesubscriptions' => array(
244 'riskbitmask' => RISK_SPAM,
246 'captype' => 'read',
247 'contextlevel' => CONTEXT_MODULE,
248 'legacy' => array(
249 'teacher' => CAP_ALLOW,
250 'editingteacher' => CAP_ALLOW,
251 'admin' => CAP_ALLOW
255 'mod/forum:initialsubscriptions' => array(
257 'captype' => 'read',
258 'contextlevel' => CONTEXT_MODULE,
259 'legacy' => array(
260 'teacher' => CAP_ALLOW,
261 'editingteacher' => CAP_ALLOW,
262 'student' => CAP_ALLOW
266 'mod/forum:throttlingapplies' => array(
268 'riskbitmask' => RISK_SPAM,
270 'captype' => 'write',
271 'contextlevel' => CONTEXT_MODULE,
272 'legacy' => array(