mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 10:56:56 +02:00
MDL-39990 wiki: more detailed validation of view/edit access
This commit is contained in:
parent
d5c7462a6a
commit
e6499fb8a4
19 changed files with 98 additions and 62 deletions
|
@ -68,8 +68,9 @@ if (!empty($section) && !$sectioncontent = wiki_get_section_page($page, $section
|
|||
|
||||
require_login($course, false, $cm);
|
||||
|
||||
$context = context_module::instance($cm->id);
|
||||
require_capability('mod/wiki:editpage', $context);
|
||||
if (!wiki_user_can_edit($subwiki)) {
|
||||
print_error('cannoteditpage', 'wiki');
|
||||
}
|
||||
|
||||
$wikipage = new page_wiki_lock($wiki, $subwiki, $cm);
|
||||
$wikipage->set_page($page);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue