3 // Capability definitions for the forum module.
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.
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(
39 'contextlevel' => CONTEXT_MODULE
,
42 'student' => CAP_ALLOW
,
43 'teacher' => CAP_ALLOW
,
44 'editingteacher' => CAP_ALLOW
,
49 'mod/forum:viewhiddentimedposts' => array(
52 'contextlevel' => CONTEXT_MODULE
,
54 'teacher' => CAP_ALLOW
,
55 'editingteacher' => CAP_ALLOW
,
60 'mod/forum:startdiscussion' => array(
62 'riskbitmask' => RISK_SPAM
,
65 'contextlevel' => CONTEXT_MODULE
,
67 'student' => CAP_ALLOW
,
68 'teacher' => CAP_ALLOW
,
69 'editingteacher' => CAP_ALLOW
,
74 'mod/forum:replypost' => array(
76 'riskbitmask' => RISK_SPAM
,
79 'contextlevel' => CONTEXT_MODULE
,
81 'student' => CAP_ALLOW
,
82 'teacher' => CAP_ALLOW
,
83 'editingteacher' => CAP_ALLOW
,
88 'mod/forum:addnews' => array(
90 'riskbitmask' => RISK_SPAM
,
93 'contextlevel' => CONTEXT_MODULE
,
95 'teacher' => CAP_ALLOW
,
96 'editingteacher' => CAP_ALLOW
,
101 'mod/forum:replynews' => array(
103 'riskbitmask' => RISK_SPAM
,
105 'captype' => 'write',
106 'contextlevel' => CONTEXT_MODULE
,
108 'teacher' => CAP_ALLOW
,
109 'editingteacher' => CAP_ALLOW
,
114 'mod/forum:viewrating' => array(
117 'contextlevel' => CONTEXT_MODULE
,
119 'student' => CAP_ALLOW
,
120 'teacher' => CAP_ALLOW
,
121 'editingteacher' => CAP_ALLOW
,
126 'mod/forum:viewanyrating' => array(
129 'contextlevel' => CONTEXT_MODULE
,
131 'teacher' => CAP_ALLOW
,
132 'editingteacher' => CAP_ALLOW
,
137 'mod/forum:rate' => array(
139 'captype' => 'write',
140 'contextlevel' => CONTEXT_MODULE
,
142 'teacher' => CAP_ALLOW
,
143 'editingteacher' => CAP_ALLOW
,
148 'mod/forum:createattachment' => array(
150 'riskbitmask' => RISK_SPAM
,
152 'captype' => 'write',
153 'contextlevel' => CONTEXT_MODULE
,
155 'student' => CAP_ALLOW
,
156 'teacher' => CAP_ALLOW
,
157 'editingteacher' => CAP_ALLOW
,
162 'mod/forum:deleteownpost' => array(
165 'contextlevel' => CONTEXT_MODULE
,
167 'student' => CAP_ALLOW
,
168 'teacher' => CAP_ALLOW
,
169 'editingteacher' => CAP_ALLOW
,
174 'mod/forum:deleteanypost' => array(
177 'contextlevel' => CONTEXT_MODULE
,
179 'teacher' => CAP_ALLOW
,
180 'editingteacher' => CAP_ALLOW
,
185 'mod/forum:splitdiscussions' => array(
188 'contextlevel' => CONTEXT_MODULE
,
190 'teacher' => CAP_ALLOW
,
191 'editingteacher' => CAP_ALLOW
,
196 'mod/forum:movediscussions' => array(
199 'contextlevel' => CONTEXT_MODULE
,
201 'teacher' => CAP_ALLOW
,
202 'editingteacher' => CAP_ALLOW
,
207 'mod/forum:editanypost' => array(
209 'riskbitmask' => RISK_SPAM
,
211 'captype' => 'write',
212 'contextlevel' => CONTEXT_MODULE
,
214 'teacher' => CAP_ALLOW
,
215 'editingteacher' => CAP_ALLOW
,
220 'mod/forum:viewqandawithoutposting' => array(
223 'contextlevel' => CONTEXT_MODULE
,
225 'teacher' => CAP_ALLOW
,
226 'editingteacher' => CAP_ALLOW
,
231 'mod/forum:viewsubscribers' => array(
234 'contextlevel' => CONTEXT_MODULE
,
236 'teacher' => CAP_ALLOW
,
237 'editingteacher' => CAP_ALLOW
,
242 'mod/forum:managesubscriptions' => array(
244 'riskbitmask' => RISK_SPAM
,
247 'contextlevel' => CONTEXT_MODULE
,
249 'teacher' => CAP_ALLOW
,
250 'editingteacher' => CAP_ALLOW
,
255 'mod/forum:initialsubscriptions' => array(
258 'contextlevel' => CONTEXT_MODULE
,
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
,