From: vyshane Date: Mon, 18 Sep 2006 13:46:09 +0000 (+0000) Subject: Added new capabilities, renamed mod/data:readentry to mod/data:viewentry to make... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=20821a1266e1269a6e56c518bd81dc500cc2c870;p=moodle.git Added new capabilities, renamed mod/data:readentry to mod/data:viewentry to make capability name more consistent with the rest of moodle. --- diff --git a/mod/data/db/access.php b/mod/data/db/access.php index 5581f7fd99..fde55f1da4 100644 --- a/mod/data/db/access.php +++ b/mod/data/db/access.php @@ -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( ); -?> +?> \ No newline at end of file diff --git a/mod/data/view.php b/mod/data/view.php index b4a75dfaed..df55822fab 100755 --- a/mod/data/view.php +++ b/mod/data/view.php @@ -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)) {