From f4862fbebe801190b9c885df290c64a48340e2e4 Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 1 May 2008 22:35:36 +0000 Subject: [PATCH] MDL-14617 removed isteacheredit() - yay! --- lib/deprecatedlib.php | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index d4a1354871..d42c54ea9c 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -151,30 +151,6 @@ function isteacherinanycourse($userid=0, $includeadmin=true) { return false; } -/** - * Determines if a user is allowed to edit a given course - * - * @param int $courseid The id of the course that is being edited - * @param int $userid The id of the user that is being tested against. Set this to 0 if you would just like to test against the currently logged in user. - * @return bool - */ -function isteacheredit($courseid, $userid=0, $obsolete_ignorestudentview=false) { - global $CFG; - - if (empty($CFG->rolesactive)) { - return false; - } - - if (empty($courseid)) { - $context = get_context_instance(CONTEXT_SYSTEM); - } else { - $context = get_context_instance(CONTEXT_COURSE, $courseid); - } - - return (has_capability('moodle/legacy:editingteacher', $context, $userid, false) - or has_capability('moodle/legacy:admin', $context, $userid, false)); -} - /** * Determines if a user can create new courses * -- 2.39.5