$string['csvimport'] = 'CSV file import';
$string['data:approve'] = 'Approve unapproved entries';
$string['data:comment'] = 'Write comments';
+$string['data:exportentry'] = 'Export a database entry';
+$string['data:exportownentry'] = 'Export own database entry';
+$string['data:exportallentries'] = 'Export all database entries';
$string['data:managecomments'] = 'Manage comments';
$string['data:manageentries'] = 'Manage entries';
$string['data:managetemplates'] = 'Manage templates';
'legacy' => array(
'admin' => CAP_ALLOW
)
- )
+ ),
+
+ 'mod/data:exportentry' => array(
+
+ 'riskbitmask' => RISK_PERSONAL,
+
+ 'captype' => 'read',
+ 'contextlevel' => CONTEXT_MODULE,
+ 'legacy' => array(
+ 'admin' => CAP_ALLOW,
+ 'teacher' => CAP_ALLOW,
+ 'editingteacher' => CAP_ALLOW,
+ )
+ ),
+
+ 'mod/data:exportownentry' => array(
+
+ 'captype' => 'read',
+ 'contextlevel' => CONTEXT_MODULE,
+ 'legacy' => array(
+ 'admin' => CAP_ALLOW,
+ 'teacher' => CAP_ALLOW,
+ 'editingteacher' => CAP_ALLOW,
+ 'student' => CAP_ALLOW,
+ )
+ ),
+
+ 'mod/data:exportallentries' => array(
+
+ 'riskbitmask' => RISK_PERSONAL,
+ 'captype' => 'read',
+ 'contextlevel' => CONTEXT_MODULE,
+ 'legacy' => array(
+ 'admin' => CAP_ALLOW,
+ 'teacher' => CAP_ALLOW,
+ 'editingteacher' => CAP_ALLOW,
+ )
+ ),
);
?>
}
public function check_permissions() {
- // @todo
- return true;
+ return has_capability('mod/data:exportallentries', get_context_instance(CONTEXT_MODULE, $this->cm->id));
}
public static function display_name() {
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
-$module->version = 2007101513;
+$module->version = 2007101514;
$module->requires = 2007101509; // Requires this Moodle version
$module->cron = 60;