Revert "MDL-30482 create new capability for viewing glossary entries"
[moodle.git] / mod / glossary / db / access.php
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:
17 //   [mod/block]/<plugin_name>:<capabilityname>
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 //
28 // The variable name for the capability definitions array is $capabilities
31 $capabilities = array(
33     'mod/glossary:write' => array(
35         'riskbitmask' => RISK_SPAM,
37         'captype' => 'write',
38         'contextlevel' => CONTEXT_MODULE,
39         'archetypes' => array(
40             'student' => CAP_ALLOW,
41             'teacher' => CAP_ALLOW,
42             'editingteacher' => CAP_ALLOW,
43             'manager' => CAP_ALLOW
44         )
45     ),
47     'mod/glossary:manageentries' => array(
49         'riskbitmask' => RISK_SPAM,
51         'captype' => 'write',
52         'contextlevel' => CONTEXT_MODULE,
53         'archetypes' => array(
54             'teacher' => CAP_ALLOW,
55             'editingteacher' => CAP_ALLOW,
56             'manager' => CAP_ALLOW
57         )
58     ),
60     'mod/glossary:managecategories' => array(
62         'riskbitmask' => RISK_SPAM,
64         'captype' => 'write',
65         'contextlevel' => CONTEXT_MODULE,
66         'archetypes' => array(
67             'teacher' => CAP_ALLOW,
68             'editingteacher' => CAP_ALLOW,
69             'manager' => CAP_ALLOW
70         )
71     ),
73     'mod/glossary:comment' => array(
75         'riskbitmask' => RISK_SPAM,
77         'captype' => 'write',
78         'contextlevel' => CONTEXT_MODULE,
79         'archetypes' => array(
80             'student' => CAP_ALLOW,
81             'teacher' => CAP_ALLOW,
82             'editingteacher' => CAP_ALLOW,
83             'manager' => CAP_ALLOW
84         )
85     ),
87     'mod/glossary:managecomments' => array(
89         'riskbitmask' => RISK_SPAM,
91         'captype' => 'write',
92         'contextlevel' => CONTEXT_MODULE,
93         'archetypes' => array(
94             'teacher' => CAP_ALLOW,
95             'editingteacher' => CAP_ALLOW,
96             'manager' => CAP_ALLOW
97         )
98     ),
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
110         )
111     ),
113     'mod/glossary:export' => array(
115         'captype' => 'read',
116         'contextlevel' => CONTEXT_MODULE,
117         'archetypes' => array(
118             'teacher' => CAP_ALLOW,
119             'editingteacher' => CAP_ALLOW,
120             'manager' => CAP_ALLOW
121         )
122     ),
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
134         )
135     ),
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
145         )
146     ),
148     'mod/glossary:viewrating' => array(
150         'captype' => 'read',
151         'contextlevel' => CONTEXT_MODULE,
152         'archetypes' => array(
153             'teacher' => CAP_ALLOW,
154             'editingteacher' => CAP_ALLOW,
155             'manager' => CAP_ALLOW
156         )
157     ),
159     'mod/glossary:viewanyrating' => array(
161         'riskbitmask' => RISK_PERSONAL,
162         'captype' => 'read',
163         'contextlevel' => CONTEXT_MODULE,
164         'archetypes' => array(
165             'teacher' => CAP_ALLOW,
166             'editingteacher' => CAP_ALLOW,
167             'manager' => CAP_ALLOW
168         ),
169         'clonepermissionsfrom' =>  'mod/glossary:viewrating'
170     ),
172     'mod/glossary:viewallratings' => array(
174         'riskbitmask' => RISK_PERSONAL,
175         'captype' => 'read',
176         'contextlevel' => CONTEXT_MODULE,
177         'archetypes' => array(
178             'teacher' => CAP_ALLOW,
179             'editingteacher' => CAP_ALLOW,
180             'manager' => CAP_ALLOW
181         ),
182         'clonepermissionsfrom' =>  'mod/glossary:viewrating'
183     ),
185     'mod/glossary:exportentry' => array(
187         'riskbitmask' => RISK_PERSONAL,
189         'captype' => 'read',
190         'contextlevel' => CONTEXT_MODULE,
191         'archetypes' => array(
192             'teacher' => CAP_ALLOW,
193             'editingteacher' => CAP_ALLOW,
194             'manager' => CAP_ALLOW
195         )
196     ),
198     'mod/glossary:exportownentry' => array(
200         'captype' => 'read',
201         'contextlevel' => CONTEXT_MODULE,
202         'archetypes' => array(
203             'teacher' => CAP_ALLOW,
204             'editingteacher' => CAP_ALLOW,
205             'manager' => CAP_ALLOW,
206             'student' => CAP_ALLOW,
207         )
208     ),
210 );