mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 04:33:13 +01:00
Added new capabilities, renamed mod/data:readentry to mod/data:viewentry to make capability name more consistent with the rest of moodle.
This commit is contained in:
parent
a229726a11
commit
20821a1266
@ -33,12 +33,12 @@
|
||||
|
||||
$mod_data_capabilities = array(
|
||||
|
||||
'mod/data:readentry' => array(
|
||||
'mod/data:viewentry' => array(
|
||||
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_MODULE,
|
||||
'legacy' => array(
|
||||
'guest' => CAP_ALLOW,
|
||||
'guest' => CAP_PREVENT,
|
||||
'student' => CAP_ALLOW,
|
||||
'teacher' => CAP_ALLOW,
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
@ -47,6 +47,20 @@ $mod_data_capabilities = array(
|
||||
)
|
||||
),
|
||||
|
||||
'mod/data:viewentriesfromallgrous' => array(
|
||||
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_MODULE,
|
||||
'legacy' => array(
|
||||
'guest' => CAP_PREVENT,
|
||||
'student' => CAP_PREVENT,
|
||||
'teacher' => CAP_ALLOW,
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'coursecreator' => CAP_ALLOW,
|
||||
'admin' => CAP_ALLOW
|
||||
)
|
||||
),
|
||||
|
||||
'mod/data:writeentry' => array(
|
||||
|
||||
'captype' => 'write',
|
||||
@ -75,6 +89,20 @@ $mod_data_capabilities = array(
|
||||
)
|
||||
),
|
||||
|
||||
'mod/data:viewrating' => array(
|
||||
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_MODULE,
|
||||
'legacy' => array(
|
||||
'guest' => CAP_PREVENT,
|
||||
'student' => CAP_PREVENT,
|
||||
'teacher' => CAP_ALLOW,
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'coursecreator' => CAP_ALLOW,
|
||||
'admin' => CAP_ALLOW
|
||||
)
|
||||
),
|
||||
|
||||
'mod/data:rate' => array(
|
||||
|
||||
'captype' => 'write',
|
||||
@ -147,4 +175,4 @@ $mod_data_capabilities = array(
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
?>
|
@ -84,7 +84,7 @@
|
||||
require_course_login($course, true, $cm);
|
||||
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
require_capability('mod/data:readentry', $context);
|
||||
require_capability('mod/data:viewentry', $context);
|
||||
|
||||
/// If it's hidden then it's don't show anything. :)
|
||||
if (empty($cm->visible) and !has_capability('mod/data:managetemplates', $context)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user