From 4349322ede7c56d44b87398be2c038821a2e3849 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Thu, 13 Aug 2015 21:35:21 +1200 Subject: [PATCH] Don't hide view capability in a function. --- locallib.php | 4 ---- view.php | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/locallib.php b/locallib.php index e6808c3..9f2cb38 100644 --- a/locallib.php +++ b/locallib.php @@ -66,10 +66,6 @@ class attendance_permissions { return $this->canview; } - public function require_view_capability() { - require_capability('mod/attendance:view', $this->context); - } - public function can_view_reports() { if (is_null($this->canviewreports)) { $this->canviewreports = has_capability('mod/attendance:viewreports', $this->context); diff --git a/view.php b/view.php index 51e7eb4..f776d61 100644 --- a/view.php +++ b/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_title($course->shortname. ": ".$att->name);