mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-15768 - add new capabilities to mod/data for portfolio export
This commit is contained in:
parent
7e51bbcee9
commit
07028cd91f
@ -54,6 +54,9 @@ $string['csvwithselecteddelimiter'] = '<acronym title=\"Comma Separated Values\"
|
||||
$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';
|
||||
|
@ -165,8 +165,45 @@ $mod_data_capabilities = array(
|
||||
'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,
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
|
@ -2478,8 +2478,7 @@ class data_portfolio_caller extends portfolio_module_caller_base {
|
||||
}
|
||||
|
||||
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() {
|
||||
|
@ -5,7 +5,7 @@
|
||||
// This fragment is called by /admin/index.php
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$module->version = 2007101513;
|
||||
$module->version = 2007101514;
|
||||
$module->requires = 2007101509; // Requires this Moodle version
|
||||
$module->cron = 60;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user