MDL-55254 mod_data: Add view permissions
authorStephen Bourget <steve.bourget@sau19.org>
Mon, 25 Jul 2016 01:00:57 +0000 (21:00 -0400)
committerStephen Bourget <steve.bourget@sau19.org>
Mon, 25 Jul 2016 01:00:57 +0000 (21:00 -0400)
course/tests/externallib_test.php
mod/data/db/access.php
mod/data/lang/en/data.php
mod/data/version.php

index fb1814a..21c38bd 100644 (file)
@@ -724,6 +724,7 @@ class core_course_externallib_testcase extends externallib_advanced_testcase {
         $context = context_course::instance($course->id);
         $roleid = $this->assignUserCapability('moodle/course:view', $context->id);
         $this->assignUserCapability('moodle/course:update', $context->id, $roleid);
+        $this->assignUserCapability('mod/data:view', $context->id, $roleid);
 
         $conditions = array('course' => $course->id, 'section' => 2);
         $DB->set_field('course_sections', 'summary', 'Text with iframe <iframe src="https://moodle.org"></iframe>', $conditions);
index 3a9a866..64d4132 100644 (file)
@@ -251,6 +251,18 @@ $capabilities = array(
             'editingteacher' => CAP_ALLOW,
         )
     ),
+
+    'mod/data:view' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_MODULE,
+        'archetypes' => array(
+            'guest' => CAP_ALLOW,
+            'student' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'manager' => CAP_ALLOW
+        )
+    )
 );
 
 
index 0fabbfe..484f9e2 100644 (file)
@@ -99,6 +99,7 @@ $string['data:viewanyrating'] = 'View total ratings that anyone received';
 $string['data:viewentry'] = 'View entries';
 $string['data:viewrating'] = 'View the total rating you received';
 $string['data:writeentry'] = 'Write entries';
+$string['data:view'] = 'View database activity';
 $string['date'] = 'Date';
 $string['dateentered'] = 'Date entered';
 $string['defaultfielddelimiter'] = '(default is the comma character)';
index 0c596bb..5325b0a 100644 (file)
@@ -24,7 +24,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2016052300;       // The current module version (Date: YYYYMMDDXX)
+$plugin->version   = 2016071500;       // The current module version (Date: YYYYMMDDXX)
 $plugin->requires  = 2016051900;       // Requires this Moodle version
 $plugin->component = 'mod_data';       // Full name of the plugin (used for diagnostics)
 $plugin->cron      = 0;