capabilities
This commit is contained in:
parent
6f02d3c301
commit
dfae16e4ff
1 changed files with 2 additions and 1 deletions
|
@ -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']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue