Revert "MDL-30482 create new capability for viewing glossary entries"
[moodle.git] / mod / glossary / db / access.php
CommitLineData
bbbf2d40 1<?php
2//
3// Capability definitions for the glossary 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).
11//
12//
13// CAPABILITY NAMING CONVENTION
14//
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:
0ac940b3 17// [mod/block]/<plugin_name>:<capabilityname>
bbbf2d40 18//
19// component_name should be the same as the directory name of the mod or block.
20//
21// Core moodle capabilities are defined thus:
22// moodle/<capabilityclass>:<capabilityname>
23//
24// Examples: mod/forum:viewpost
25// block/recent_activity:view
26// moodle/site:deleteuser
27//
0ac940b3 28// The variable name for the capability definitions array is $capabilities
bbbf2d40 29
30
0ac940b3 31$capabilities = array(
eef868d1 32
bbbf2d40 33 'mod/glossary:write' => array(
eef868d1 34
21b6db6e 35 'riskbitmask' => RISK_SPAM,
36
bbbf2d40 37 'captype' => 'write',
38 'contextlevel' => CONTEXT_MODULE,
31c93303 39 'archetypes' => array(
bbbf2d40 40 'student' => CAP_ALLOW,
41 'teacher' => CAP_ALLOW,
42 'editingteacher' => CAP_ALLOW,
4f0c2d00 43 'manager' => CAP_ALLOW
bbbf2d40 44 )
45 ),
eef868d1 46
bbbf2d40 47 'mod/glossary:manageentries' => array(
eef868d1 48
8e9eebe6 49 'riskbitmask' => RISK_SPAM,
50
bbbf2d40 51 'captype' => 'write',
52 'contextlevel' => CONTEXT_MODULE,
31c93303 53 'archetypes' => array(
bbbf2d40 54 'teacher' => CAP_ALLOW,
55 'editingteacher' => CAP_ALLOW,
4f0c2d00 56 'manager' => CAP_ALLOW
bbbf2d40 57 )
58 ),
eef868d1 59
bbbf2d40 60 'mod/glossary:managecategories' => array(
eef868d1 61
8e9eebe6 62 'riskbitmask' => RISK_SPAM,
63
bbbf2d40 64 'captype' => 'write',
65 'contextlevel' => CONTEXT_MODULE,
31c93303 66 'archetypes' => array(
bbbf2d40 67 'teacher' => CAP_ALLOW,
68 'editingteacher' => CAP_ALLOW,
4f0c2d00 69 'manager' => CAP_ALLOW
bbbf2d40 70 )
71 ),
eef868d1 72
bbbf2d40 73 'mod/glossary:comment' => array(
eef868d1 74
21b6db6e 75 'riskbitmask' => RISK_SPAM,
76
bbbf2d40 77 'captype' => 'write',
78 'contextlevel' => CONTEXT_MODULE,
31c93303 79 'archetypes' => array(
bbbf2d40 80 'student' => CAP_ALLOW,
81 'teacher' => CAP_ALLOW,
82 'editingteacher' => CAP_ALLOW,
4f0c2d00 83 'manager' => CAP_ALLOW
bbbf2d40 84 )
85 ),
eef868d1 86
bbbf2d40 87 'mod/glossary:managecomments' => array(
eef868d1 88
8e9eebe6 89 'riskbitmask' => RISK_SPAM,
90
bbbf2d40 91 'captype' => 'write',
92 'contextlevel' => CONTEXT_MODULE,
31c93303 93 'archetypes' => array(
bbbf2d40 94 'teacher' => CAP_ALLOW,
95 'editingteacher' => CAP_ALLOW,
4f0c2d00 96 'manager' => CAP_ALLOW
bbbf2d40 97 )
98 ),
eef868d1 99
bbbf2d40 100 'mod/glossary:import' => array(
eef868d1 101
21b6db6e 102 'riskbitmask' => RISK_SPAM,
103
bbbf2d40 104 'captype' => 'write',
105 'contextlevel' => CONTEXT_MODULE,
31c93303 106 'archetypes' => array(
bbbf2d40 107 'teacher' => CAP_ALLOW,
108 'editingteacher' => CAP_ALLOW,
4f0c2d00 109 'manager' => CAP_ALLOW
bbbf2d40 110 )
111 ),
eef868d1 112
bbbf2d40 113 'mod/glossary:export' => array(
eef868d1 114
b56d75dd 115 'captype' => 'read',
bbbf2d40 116 'contextlevel' => CONTEXT_MODULE,
31c93303 117 'archetypes' => array(
bbbf2d40 118 'teacher' => CAP_ALLOW,
119 'editingteacher' => CAP_ALLOW,
4f0c2d00 120 'manager' => CAP_ALLOW
bbbf2d40 121 )
122 ),
eef868d1 123
bbbf2d40 124 'mod/glossary:approve' => array(
eef868d1 125
8e9eebe6 126 'riskbitmask' => RISK_SPAM,
127
bbbf2d40 128 'captype' => 'write',
129 'contextlevel' => CONTEXT_MODULE,
31c93303 130 'archetypes' => array(
bbbf2d40 131 'teacher' => CAP_ALLOW,
132 'editingteacher' => CAP_ALLOW,
4f0c2d00 133 'manager' => CAP_ALLOW
bbbf2d40 134 )
135 ),
eef868d1 136
bbbf2d40 137 'mod/glossary:rate' => array(
eef868d1 138
bbbf2d40 139 'captype' => 'write',
140 'contextlevel' => CONTEXT_MODULE,
31c93303 141 'archetypes' => array(
bbbf2d40 142 'teacher' => CAP_ALLOW,
143 'editingteacher' => CAP_ALLOW,
4f0c2d00 144 'manager' => CAP_ALLOW
bbbf2d40 145 )
146 ),
eef868d1 147
bbbf2d40 148 'mod/glossary:viewrating' => array(
eef868d1 149
bbbf2d40 150 'captype' => 'read',
151 'contextlevel' => CONTEXT_MODULE,
31c93303 152 'archetypes' => array(
bbbf2d40 153 'teacher' => CAP_ALLOW,
154 'editingteacher' => CAP_ALLOW,
4f0c2d00 155 'manager' => CAP_ALLOW
bbbf2d40 156 )
157 ),
eef868d1 158
6595a568
MD
159 'mod/glossary:viewanyrating' => array(
160
161 'riskbitmask' => RISK_PERSONAL,
162 'captype' => 'read',
163 'contextlevel' => CONTEXT_MODULE,
31c93303 164 'archetypes' => array(
6595a568
MD
165 'teacher' => CAP_ALLOW,
166 'editingteacher' => CAP_ALLOW,
167 'manager' => CAP_ALLOW
168 ),
169 'clonepermissionsfrom' => 'mod/glossary:viewrating'
170 ),
171
172 'mod/glossary:viewallratings' => array(
173
174 'riskbitmask' => RISK_PERSONAL,
175 'captype' => 'read',
176 'contextlevel' => CONTEXT_MODULE,
31c93303 177 'archetypes' => array(
6595a568
MD
178 'teacher' => CAP_ALLOW,
179 'editingteacher' => CAP_ALLOW,
180 'manager' => CAP_ALLOW
181 ),
182 'clonepermissionsfrom' => 'mod/glossary:viewrating'
183 ),
184
86a3996d 185 'mod/glossary:exportentry' => array(
186
187 'riskbitmask' => RISK_PERSONAL,
188
189 'captype' => 'read',
190 'contextlevel' => CONTEXT_MODULE,
31c93303 191 'archetypes' => array(
86a3996d 192 'teacher' => CAP_ALLOW,
193 'editingteacher' => CAP_ALLOW,
4f0c2d00 194 'manager' => CAP_ALLOW
86a3996d 195 )
196 ),
197
198 'mod/glossary:exportownentry' => array(
199
200 'captype' => 'read',
201 'contextlevel' => CONTEXT_MODULE,
31c93303 202 'archetypes' => array(
86a3996d 203 'teacher' => CAP_ALLOW,
204 'editingteacher' => CAP_ALLOW,
4f0c2d00 205 'manager' => CAP_ALLOW,
86a3996d 206 'student' => CAP_ALLOW,
207 )
208 ),
209
bbbf2d40 210);
211
86342d63 212