mirror of
https://github.com/moodle/moodle.git
synced 2025-08-11 03:46:42 +02:00
MDL-55785 mod_glossary: Check user can create new entries
This commit is contained in:
parent
f0e1808fc4
commit
fad980b26f
2 changed files with 7 additions and 1 deletions
|
@ -226,6 +226,7 @@ class mod_glossary_external extends external_api {
|
|||
$modes[$glossary->displayformat] = self::get_browse_modes_from_display_format($glossary->displayformat);
|
||||
}
|
||||
$glossary->browsemodes = $modes[$glossary->displayformat];
|
||||
$glossary->canaddentry = has_capability('mod/glossary:write', $context) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -292,7 +293,8 @@ class mod_glossary_external extends external_api {
|
|||
'groupingid' => new external_value(PARAM_INT, 'Grouping ID'),
|
||||
'browsemodes' => new external_multiple_structure(
|
||||
new external_value(PARAM_ALPHA, 'Modes of browsing allowed')
|
||||
)
|
||||
),
|
||||
'canaddentry' => new external_value(PARAM_INT, 'Whether the user can add a new entry', VALUE_OPTIONAL),
|
||||
), 'Glossaries')
|
||||
),
|
||||
'warnings' => new external_warnings())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue