From a12e0d6ae853cd4c7419b8c755d142eeeedc36a4 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 1 Apr 2019 18:02:28 +0200 Subject: [exams] Shortcut for permcheck --- modules-available/exams/page.inc.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules-available/exams/page.inc.php b/modules-available/exams/page.inc.php index 600089fc..31593273 100644 --- a/modules-available/exams/page.inc.php +++ b/modules-available/exams/page.inc.php @@ -105,6 +105,8 @@ class Page_Exams extends Page // returns true if user is allowed to edit the exam protected function userCanEditExam($examid = NULL) { + if (in_array(0, $this->userEditLocations)) // Trivial case -- don't query if global perms + return true; if ($examid === null) return User::hasPermission('exams.edit'); // Check locations of existing exam -- cgit v1.2.3-55-g7522