From dfae16e4ff440cc5a80f75dab7a86d11bc50ac73 Mon Sep 17 00:00:00 2001 From: L_DA Date: Fri, 18 Sep 2020 20:04:04 +0000 Subject: [PATCH] capabilities --- externallib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/externallib.php b/externallib.php index c8b6125..da2f848 100644 --- a/externallib.php +++ b/externallib.php @@ -149,7 +149,8 @@ class mod_timetable_external extends external_api { //Capability checking //OPTIONAL but in most web service it should present if (!has_capability('mod/timetable:view'.$params['type'], $usercontext)) { - if (!(($params['type'] == 'class') && has_capability('mod/timetable:viewownclass', $usercontext) && ($params['name'] == str_replace('_','/',$USER->department)))) + //if (!(($params['type'] == 'class') && has_capability('mod/timetable:viewownclass', $usercontext) && ($params['name'] == str_replace('_','/',$USER->department)))) + if (!(($params['type'] == 'class') && ($params['name'] == str_replace('_','/',$USER->department)))) throw new \moodle_exception('cannotviewtimetable'.$params['type']); }