3 // Capability definitions for the glossary 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]/<plugin_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 is $capabilities
31 $capabilities = array(
33 'mod/glossary:write' => array(
35 'riskbitmask' => RISK_SPAM,
38 'contextlevel' => CONTEXT_MODULE,
39 'archetypes' => array(
40 'student' => CAP_ALLOW,
41 'teacher' => CAP_ALLOW,
42 'editingteacher' => CAP_ALLOW,
43 'manager' => CAP_ALLOW
47 'mod/glossary:manageentries' => array(
49 'riskbitmask' => RISK_SPAM,
52 'contextlevel' => CONTEXT_MODULE,
53 'archetypes' => array(
54 'teacher' => CAP_ALLOW,
55 'editingteacher' => CAP_ALLOW,
56 'manager' => CAP_ALLOW
60 'mod/glossary:managecategories' => array(
62 'riskbitmask' => RISK_SPAM,
65 'contextlevel' => CONTEXT_MODULE,
66 'archetypes' => array(
67 'teacher' => CAP_ALLOW,
68 'editingteacher' => CAP_ALLOW,
69 'manager' => CAP_ALLOW
73 'mod/glossary:comment' => array(
75 'riskbitmask' => RISK_SPAM,
78 'contextlevel' => CONTEXT_MODULE,
79 'archetypes' => array(
80 'student' => CAP_ALLOW,
81 'teacher' => CAP_ALLOW,
82 'editingteacher' => CAP_ALLOW,
83 'manager' => CAP_ALLOW
87 'mod/glossary:managecomments' => array(
89 'riskbitmask' => RISK_SPAM,
92 'contextlevel' => CONTEXT_MODULE,
93 'archetypes' => array(
94 'teacher' => CAP_ALLOW,
95 'editingteacher' => CAP_ALLOW,
96 'manager' => CAP_ALLOW
100 'mod/glossary:import' => array(
102 'riskbitmask' => RISK_SPAM,
104 'captype' => 'write',
105 'contextlevel' => CONTEXT_MODULE,
106 'archetypes' => array(
107 'teacher' => CAP_ALLOW,
108 'editingteacher' => CAP_ALLOW,
109 'manager' => CAP_ALLOW
113 'mod/glossary:export' => array(
116 'contextlevel' => CONTEXT_MODULE,
117 'archetypes' => array(
118 'teacher' => CAP_ALLOW,
119 'editingteacher' => CAP_ALLOW,
120 'manager' => CAP_ALLOW
124 'mod/glossary:approve' => array(
126 'riskbitmask' => RISK_SPAM,
128 'captype' => 'write',
129 'contextlevel' => CONTEXT_MODULE,
130 'archetypes' => array(
131 'teacher' => CAP_ALLOW,
132 'editingteacher' => CAP_ALLOW,
133 'manager' => CAP_ALLOW
137 'mod/glossary:rate' => array(
139 'captype' => 'write',
140 'contextlevel' => CONTEXT_MODULE,
141 'archetypes' => array(
142 'teacher' => CAP_ALLOW,
143 'editingteacher' => CAP_ALLOW,
144 'manager' => CAP_ALLOW
148 'mod/glossary:viewrating' => array(
151 'contextlevel' => CONTEXT_MODULE,
152 'archetypes' => array(
153 'teacher' => CAP_ALLOW,
154 'editingteacher' => CAP_ALLOW,
155 'manager' => CAP_ALLOW
159 'mod/glossary:viewanyrating' => array(
161 'riskbitmask' => RISK_PERSONAL,
163 'contextlevel' => CONTEXT_MODULE,
164 'archetypes' => array(
165 'teacher' => CAP_ALLOW,
166 'editingteacher' => CAP_ALLOW,
167 'manager' => CAP_ALLOW
169 'clonepermissionsfrom' => 'mod/glossary:viewrating'
172 'mod/glossary:viewallratings' => array(
174 'riskbitmask' => RISK_PERSONAL,
176 'contextlevel' => CONTEXT_MODULE,
177 'archetypes' => array(
178 'teacher' => CAP_ALLOW,
179 'editingteacher' => CAP_ALLOW,
180 'manager' => CAP_ALLOW
182 'clonepermissionsfrom' => 'mod/glossary:viewrating'
185 'mod/glossary:exportentry' => array(
187 'riskbitmask' => RISK_PERSONAL,
190 'contextlevel' => CONTEXT_MODULE,
191 'archetypes' => array(
192 'teacher' => CAP_ALLOW,
193 'editingteacher' => CAP_ALLOW,
194 'manager' => CAP_ALLOW
198 'mod/glossary:exportownentry' => array(
201 'contextlevel' => CONTEXT_MODULE,
202 'archetypes' => array(
203 'teacher' => CAP_ALLOW,
204 'editingteacher' => CAP_ALLOW,
205 'manager' => CAP_ALLOW,
206 'student' => CAP_ALLOW,