Skip to content

Commit

Permalink
MDL-55254 mod_data: Add view permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
sbourget committed Jul 25, 2016
1 parent 90a8bdb commit 12306a9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions course/tests/externallib_test.php
Expand Up @@ -724,6 +724,7 @@ private function prepare_get_course_contents_test() {
$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);
Expand Down
12 changes: 12 additions & 0 deletions mod/data/db/access.php
Expand Up @@ -251,6 +251,18 @@
'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
)
)
);


1 change: 1 addition & 0 deletions mod/data/lang/en/data.php
Expand Up @@ -99,6 +99,7 @@
$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)';
Expand Down
2 changes: 1 addition & 1 deletion mod/data/version.php
Expand Up @@ -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;

0 comments on commit 12306a9

Please sign in to comment.