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:
vyshane 2006-09-18 13:46:09 +00:00
parent a229726a11
commit 20821a1266
2 changed files with 32 additions and 4 deletions

View File

@ -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(
);
?>
?>

View File

@ -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)) {