summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-04-01 18:02:28 +0200
committerSimon Rettberg2019-04-01 18:02:28 +0200
commita12e0d6ae853cd4c7419b8c755d142eeeedc36a4 (patch)
treef9f570aee9c1f6e0a629ff9979691c6202b2f255
parentslx-fixes.js: Move more code to document.ready event (diff)
downloadslx-admin-a12e0d6ae853cd4c7419b8c755d142eeeedc36a4.tar.gz
slx-admin-a12e0d6ae853cd4c7419b8c755d142eeeedc36a4.tar.xz
slx-admin-a12e0d6ae853cd4c7419b8c755d142eeeedc36a4.zip
[exams] Shortcut for permcheck
-rw-r--r--modules-available/exams/page.inc.php2
1 files changed, 2 insertions, 0 deletions
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