MDL-47759 tool_monitor: Fix permissions issue

This commit is contained in:
Ankit Agarwal
2014-10-20 13:45:51 +05:30
parent b49de5d930
commit 5875e287a5
2 changed files with 3 additions and 2 deletions
@@ -154,7 +154,7 @@ class renderable extends \table_sql implements \renderable {
$manage = '';
// We don't need to check for capability at course level since, user is never shown this page,
// if he doesn't have the capability.
if ($this->hassystemcap || ($rule->courseid !== 0)) {
if ($this->hassystemcap || ($rule->courseid != 0)) {
// There might be site rules which the user can not manage.
$editurl = new \moodle_url($CFG->wwwroot. '/admin/tool/monitor/edit.php', array('ruleid' => $rule->id,
'courseid' => $rule->courseid, 'sesskey' => sesskey()));
@@ -175,7 +175,7 @@ class renderable extends \table_sql implements \renderable {
$icon = $OUTPUT->action_link($deleteurl, new \pix_icon('t/delete', get_string('deleterule', 'tool_monitor')), $action);
$manage .= $icon;
} else {
$manage = '-';
$manage = get_string('nopermission', 'tool_monitor');
}
return $manage;
}
@@ -61,6 +61,7 @@ $string['messagetemplate_help'] = 'This is the content of the message that will
$string['minutes'] = 'in minutes:';
$string['name'] = 'Name of the rule: ';
$string['name_help'] = "Choose a name for the rule.";
$string['nopermission'] = "No permission";
$string['pluginname'] = 'Event monitor';
$string['processevents'] = 'Process events';
$string['ruleareyousure'] = 'Are you sure you want to delete rule "{$a}"?';