From de06ce7ed328dfe160722805500e0f8d69a59edd Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Tue, 10 Jun 2014 11:55:54 +0800 Subject: [PATCH] MDL-45940 Assign: Improved access check Call can_edit() instead of repeating a (slightly wrong) access check. --- mod/assign/locallib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index 95b8dde6631..72e31a4c619 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -3678,10 +3678,9 @@ class assign { } if ($this->can_view_submission($user->id)) { - $showedit = has_capability('mod/assign:submit', $this->context) && - $this->submissions_open($user->id) && + $showedit = $showlinks && ($this->is_any_submission_plugin_enabled()) && - $showlinks; + $this->can_edit_submission($user->id); $gradelocked = ($flags && $flags->locked) || $this->grading_disabled($user->id, false);