access.php 6.74 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
//
// Capability definitions for the forum module.
//
// The capabilities are loaded into the database table when the module is
// installed or updated. Whenever the capability definitions are updated,
// the module version number should be bumped up.
//
// The system has four possible values for a capability:
// CAP_ALLOW, CAP_PREVENT, CAP_PROHIBIT, and inherit (not set).
//
//
// CAPABILITY NAMING CONVENTION
//
// It is important that capability names are unique. The naming convention
// for capabilities that are specific to modules and blocks is as follows:
//   [mod/block]/<component_name>:<capabilityname>
//
// component_name should be the same as the directory name of the mod or block.
//
// Core moodle capabilities are defined thus:
//    moodle/<capabilityclass>:<capabilityname>
//
// Examples: mod/forum:viewpost
//           block/recent_activity:view
//           moodle/site:deleteuser
//
// The variable name for the capability definitions array follows the format
//   $<componenttype>_<component_name>_capabilities
//
// For the core capabilities, the variable is $moodle_capabilities.


$mod_forum_capabilities = array(
35

36
    'mod/forum:viewdiscussion' => array(
37

38
39
40
        'captype' => 'read',
        'contextlevel' => CONTEXT_MODULE,
        'legacy' => array(
41
            'guest' => CAP_ALLOW,
42
43
44
45
46
47
48
            'student' => CAP_ALLOW,
            'teacher' => CAP_ALLOW,
            'editingteacher' => CAP_ALLOW,
            'coursecreator' => CAP_ALLOW,
            'admin' => CAP_ALLOW
        )
    ),
49

vyshane's avatar
vyshane committed
50
    'mod/forum:viewhiddentimedposts' => array(
51

vyshane's avatar
vyshane committed
52
53
54
55
56
57
58
59
60
        'captype' => 'read',
        'contextlevel' => CONTEXT_MODULE,
        'legacy' => array(
            'teacher' => CAP_ALLOW,
            'editingteacher' => CAP_ALLOW,
            'coursecreator' => CAP_ALLOW,
            'admin' => CAP_ALLOW
        )
    ),
61

62
    'mod/forum:startdiscussion' => array(
63

64
65
66
        'riskbitmask' => RISK_SPAM,

        'captype' => 'write',
67
68
69
70
71
72
73
74
75
        'contextlevel' => CONTEXT_MODULE,
        'legacy' => array(
            'student' => CAP_ALLOW,
            'teacher' => CAP_ALLOW,
            'editingteacher' => CAP_ALLOW,
            'coursecreator' => CAP_ALLOW,
            'admin' => CAP_ALLOW
        )
    ),
76

77
    'mod/forum:replypost' => array(
78

79
80
81
        'riskbitmask' => RISK_SPAM,

        'captype' => 'write',
82
83
84
85
86
87
88
89
90
        'contextlevel' => CONTEXT_MODULE,
        'legacy' => array(
            'student' => CAP_ALLOW,
            'teacher' => CAP_ALLOW,
            'editingteacher' => CAP_ALLOW,
            'coursecreator' => CAP_ALLOW,
            'admin' => CAP_ALLOW
        )
    ),
91

92
    'mod/forum:viewrating' => array(
93

94
95
96
97
98
99
100
101
102
103
        'captype' => 'read',
        'contextlevel' => CONTEXT_MODULE,
        'legacy' => array(
            'student' => CAP_ALLOW,
            'teacher' => CAP_ALLOW,
            'editingteacher' => CAP_ALLOW,
            'coursecreator' => CAP_ALLOW,
            'admin' => CAP_ALLOW
        )
    ),
104

105
    'mod/forum:viewanyrating' => array(
106

107
108
109
110
111
112
113
114
115
        'captype' => 'read',
        'contextlevel' => CONTEXT_MODULE,
        'legacy' => array(
            'teacher' => CAP_ALLOW,
            'editingteacher' => CAP_ALLOW,
            'coursecreator' => CAP_ALLOW,
            'admin' => CAP_ALLOW
        )
    ),
116

117
    'mod/forum:rate' => array(
118

119
        'captype' => 'write',
120
121
122
123
124
125
126
127
        'contextlevel' => CONTEXT_MODULE,
        'legacy' => array(
            'teacher' => CAP_ALLOW,
            'editingteacher' => CAP_ALLOW,
            'coursecreator' => CAP_ALLOW,
            'admin' => CAP_ALLOW
        )
    ),
128

129
    'mod/forum:createattachment' => array(
130

131
132
133
        'riskbitmask' => RISK_SPAM,

        'captype' => 'write',
134
135
136
137
138
139
140
141
142
        'contextlevel' => CONTEXT_MODULE,
        'legacy' => array(
            'student' => CAP_ALLOW,
            'teacher' => CAP_ALLOW,
            'editingteacher' => CAP_ALLOW,
            'coursecreator' => CAP_ALLOW,
            'admin' => CAP_ALLOW
        )
    ),
143

144
    'mod/forum:deleteownpost' => array(
145

146
147
148
149
150
151
152
153
154
155
        'captype' => 'read',
        'contextlevel' => CONTEXT_MODULE,
        'legacy' => array(
            'student' => CAP_ALLOW,
            'teacher' => CAP_ALLOW,
            'editingteacher' => CAP_ALLOW,
            'coursecreator' => CAP_ALLOW,
            'admin' => CAP_ALLOW
        )
    ),
156

157
    'mod/forum:deleteanypost' => array(
158

159
160
161
162
163
164
165
166
167
        'captype' => 'read',
        'contextlevel' => CONTEXT_MODULE,
        'legacy' => array(
            'teacher' => CAP_ALLOW,
            'editingteacher' => CAP_ALLOW,
            'coursecreator' => CAP_ALLOW,
            'admin' => CAP_ALLOW
        )
    ),
168

169
    'mod/forum:splitdiscussions' => array(
170

171
172
173
174
175
176
177
178
179
        'captype' => 'read',
        'contextlevel' => CONTEXT_MODULE,
        'legacy' => array(
            'teacher' => CAP_ALLOW,
            'editingteacher' => CAP_ALLOW,
            'coursecreator' => CAP_ALLOW,
            'admin' => CAP_ALLOW
        )
    ),
180

181
    'mod/forum:movediscussions' => array(
182

183
184
185
186
187
188
189
190
191
        'captype' => 'read',
        'contextlevel' => CONTEXT_MODULE,
        'legacy' => array(
            'teacher' => CAP_ALLOW,
            'editingteacher' => CAP_ALLOW,
            'coursecreator' => CAP_ALLOW,
            'admin' => CAP_ALLOW
        )
    ),
192

193
    'mod/forum:editanypost' => array(
194

195
196
197
        'riskbitmask' => RISK_SPAM,

        'captype' => 'write',
198
199
200
201
202
203
204
205
        'contextlevel' => CONTEXT_MODULE,
        'legacy' => array(
            'teacher' => CAP_ALLOW,
            'editingteacher' => CAP_ALLOW,
            'coursecreator' => CAP_ALLOW,
            'admin' => CAP_ALLOW
        )
    ),
206

207
    'mod/forum:viewqandawithoutposting' => array(
208

209
210
211
212
213
214
215
216
217
        'captype' => 'read',
        'contextlevel' => CONTEXT_MODULE,
        'legacy' => array(
            'teacher' => CAP_ALLOW,
            'editingteacher' => CAP_ALLOW,
            'coursecreator' => CAP_ALLOW,
            'admin' => CAP_ALLOW
        )
    ),
218

219
    'mod/forum:viewsubscribers' => array(
220

221
222
223
224
225
226
227
228
229
        'captype' => 'read',
        'contextlevel' => CONTEXT_MODULE,
        'legacy' => array(
            'teacher' => CAP_ALLOW,
            'editingteacher' => CAP_ALLOW,
            'coursecreator' => CAP_ALLOW,
            'admin' => CAP_ALLOW
        )
    ),
230

231
    'mod/forum:managesubscriptions' => array(
232

233
234
235
236
237
238
239
240
        'captype' => 'read',
        'contextlevel' => CONTEXT_MODULE,
        'legacy' => array(
            'teacher' => CAP_ALLOW,
            'editingteacher' => CAP_ALLOW,
            'coursecreator' => CAP_ALLOW,
            'admin' => CAP_ALLOW
        )
vyshane's avatar
vyshane committed
241
    ),
242

243
244
245
    'mod/forum:nothrottling' => array(

        'riskbitmask' => RISK_SPAM,
246

vyshane's avatar
vyshane committed
247
248
249
        'captype' => 'write',
        'contextlevel' => CONTEXT_MODULE,
        'legacy' => array(
250
251
252
253
            'teacher' => CAP_ALLOW,
            'editingteacher' => CAP_ALLOW,
            'coursecreator' => CAP_ALLOW,
            'admin' => CAP_ALLOW
vyshane's avatar
vyshane committed
254
255
        )
    )
256
257
);

258
?>