Skip to content
Permalink
Browse files

Add config "block_editor_file_manager_for_students" BT#15437

Block student's access to the course documents
when using the ckeditor "Browse server" button
  • Loading branch information...
jmontoyaa committed Mar 28, 2019
1 parent dcc6bcc commit 4cb8f2e1b46328956ba8e5185cfddb58efc223a0
@@ -20,6 +20,17 @@
//'CourseUserDriver',
//'HomeDriver'
];
$block = api_get_configuration_value('block_editor_file_manager_for_students');
$newDriverList = [];
if ($block && !api_is_allowed_to_edit()) {
foreach ($driverList as $driver) {
if ($driver === 'CourseDriver') {
continue;
}
$newDriverList[] = $driver;
}
$driverList = $newDriverList;
}
}
$connector->setDriverList($driverList);
@@ -1156,6 +1156,9 @@
// - launch composer install to rebuild the autoload.php
//$_configuration['social_enable_likes_messages'] = false;
// Block student's access to the course documents when using the ckeditor "Browse server" button
//$_configuration['block_editor_file_manager_for_students'] = false;
// KEEP THIS AT THE END
// -------- Custom DB changes
// Add user activation by confirmation email
@@ -340,6 +340,11 @@ public function allow()
return false;
}
$block = api_get_configuration_value('block_editor_file_manager_for_students');
if ($block && !api_is_allowed_to_edit()) {
return false;
}
if (isset($this->connector->course) && !empty($this->connector->course)) {
return true;
}

0 comments on commit 4cb8f2e

Please sign in to comment.
You can’t perform that action at this time.