3 // Capability definitions for the data 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_data_capabilities = array(
36 'mod/data:viewentry' => array(
39 'contextlevel' => CONTEXT_MODULE
,
42 'student' => CAP_ALLOW
,
43 'teacher' => CAP_ALLOW
,
44 'editingteacher' => CAP_ALLOW
,
49 'mod/data:writeentry' => array(
51 'riskbitmask' => RISK_SPAM
,
54 'contextlevel' => CONTEXT_MODULE
,
56 'student' => CAP_ALLOW
,
57 'teacher' => CAP_ALLOW
,
58 'editingteacher' => CAP_ALLOW
,
63 'mod/data:comment' => array(
65 'riskbitmask' => RISK_SPAM
,
68 'contextlevel' => CONTEXT_MODULE
,
70 'student' => CAP_ALLOW
,
71 'teacher' => CAP_ALLOW
,
72 'editingteacher' => CAP_ALLOW
,
77 'mod/data:viewrating' => array(
80 'contextlevel' => CONTEXT_MODULE
,
82 'teacher' => CAP_ALLOW
,
83 'editingteacher' => CAP_ALLOW
,
88 'mod/data:rate' => array(
91 'contextlevel' => CONTEXT_MODULE
,
93 'teacher' => CAP_ALLOW
,
94 'editingteacher' => CAP_ALLOW
,
99 'mod/data:approve' => array(
101 'captype' => 'write',
102 'contextlevel' => CONTEXT_MODULE
,
104 'teacher' => CAP_ALLOW
,
105 'editingteacher' => CAP_ALLOW
,
110 'mod/data:manageentries' => array(
112 'riskbitmask' => RISK_SPAM
,
114 'captype' => 'write',
115 'contextlevel' => CONTEXT_MODULE
,
117 'teacher' => CAP_ALLOW
,
118 'editingteacher' => CAP_ALLOW
,
123 'mod/data:managecomments' => array(
125 'riskbitmask' => RISK_SPAM
,
127 'captype' => 'write',
128 'contextlevel' => CONTEXT_MODULE
,
130 'teacher' => CAP_ALLOW
,
131 'editingteacher' => CAP_ALLOW
,
136 'mod/data:managetemplates' => array(
138 'riskbitmask' => RISK_SPAM | RISK_XSS
,
140 'captype' => 'write',
141 'contextlevel' => CONTEXT_MODULE
,
143 'editingteacher' => CAP_ALLOW
,
148 'mod/data:viewalluserpresets' => array(
151 'contextlevel' => CONTEXT_MODULE
,
153 'teacher' => CAP_ALLOW
,
154 'editingteacher' => CAP_ALLOW
,
159 'mod/data:manageuserpresets' => array(
161 'riskbitmask' => RISK_SPAM | RISK_XSS
,
163 'captype' => 'write',
164 'contextlevel' => CONTEXT_MODULE
,