mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-64984 mod_glossary: capability check when restoring global type.
This commit is contained in:
parent
51af50ade5
commit
80782f8907
@ -69,6 +69,9 @@ class restore_glossary_activity_structure_step extends restore_activity_structur
|
||||
if (!in_array($data->displayformat, $formats)) {
|
||||
$data->displayformat = 'dictionary';
|
||||
}
|
||||
if (!empty($data->globalglossary) && !has_capability('mod/glossary:manageentries', context_system::instance())) {
|
||||
$data->globalglossary = 0;
|
||||
}
|
||||
if (!empty($data->mainglossary) and $data->mainglossary == 1 and
|
||||
$DB->record_exists('glossary', array('mainglossary' => 1, 'course' => $this->get_courseid()))) {
|
||||
// Only allow one main glossary in the course
|
||||
|
Loading…
x
Reference in New Issue
Block a user