Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Verified Commit 69be58d0 authored by David Beniamine's avatar David Beniamine
Browse files

Do not grantTeacherAccess for students

parent 8bd781e7
...@@ -45,7 +45,6 @@ $coursecontext = context_course::instance($course->id); ...@@ -45,7 +45,6 @@ $coursecontext = context_course::instance($course->id);
// the teacher has access to all the missions and classes used in this course // the teacher has access to all the missions and classes used in this course
$isTeacher = has_capability('moodle/course:manageactivities', $coursecontext) $isTeacher = has_capability('moodle/course:manageactivities', $coursecontext)
|| has_capability('mod/labnbook:addinstance', $coursecontext); || has_capability('mod/labnbook:addinstance', $coursecontext);
helper::grantTeacherAccess($course->id);
/* /*
$event = \mod_labnbook\event\course_module_viewed::create(array( $event = \mod_labnbook\event\course_module_viewed::create(array(
...@@ -70,6 +69,7 @@ $templateData = [ ...@@ -70,6 +69,7 @@ $templateData = [
'redirecturl' => $fetcher->getRedirectUrl(), 'redirecturl' => $fetcher->getRedirectUrl(),
]; ];
if ($isTeacher) { if ($isTeacher) {
helper::grantTeacherAccess($course->id);
// editing teacher view // editing teacher view
$templateName = 'view_teacher'; $templateName = 'view_teacher';
$templateData['token_teaming'] = $fetcher->getTeamingTokenForRedirect($moduleinstance->labnbook_teamconfigid); $templateData['token_teaming'] = $fetcher->getTeamingTokenForRedirect($moduleinstance->labnbook_teamconfigid);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment