Merge branch 'master' of gitlab.steinbeisschule-reutlingen.de:L_DA/mod_timetable

This commit is contained in:
L_DA 2020-09-24 19:46:12 +02:00
commit aefe6411a4

View file

@ -149,7 +149,8 @@ class mod_timetable_external extends external_api {
//Capability checking //Capability checking
//OPTIONAL but in most web service it should present //OPTIONAL but in most web service it should present
if (!has_capability('mod/timetable:view'.$params['type'], $usercontext)) { 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']); throw new \moodle_exception('cannotviewtimetable'.$params['type']);
} }