Browse Source

Don't hide view capability in a function.

MOODLE_29_STABLE
Dan Marsden 10 years ago
parent
commit
4349322ede
  1. 4
      locallib.php
  2. 2
      view.php

4
locallib.php

@ -66,10 +66,6 @@ class attendance_permissions {
return $this->canview; return $this->canview;
} }
public function require_view_capability() {
require_capability('mod/attendance:view', $this->context);
}
public function can_view_reports() { public function can_view_reports() {
if (is_null($this->canviewreports)) { if (is_null($this->canviewreports)) {
$this->canviewreports = has_capability('mod/attendance:viewreports', $this->context); $this->canviewreports = has_capability('mod/attendance:viewreports', $this->context);

2
view.php

@ -53,7 +53,7 @@ if (!$pageparams->studentid) {
} }
} }
$att->perm->require_view_capability(); require_capability('mod/attendance:view', $PAGE->context);
$PAGE->set_url($att->url_view()); $PAGE->set_url($att->url_view());
$PAGE->set_title($course->shortname. ": ".$att->name); $PAGE->set_title($course->shortname. ": ".$att->name);

Loading…
Cancel
Save