Commit 092cb585 authored by Aaron Wells's avatar Aaron Wells Committed by Son Nguyen

Image Gallery: Make sure the user has access to the selected folder

Bug 1236636

Change-Id: I69deb64a5113806ec89145c1213f6a1d10038d78
Signed-off-by: Aaron Wells's avatarAaron Wells <aaronw@catalyst.net.nz>
parent bd33b9c8
......@@ -592,6 +592,15 @@ class PluginBlocktypeGallery extends PluginBlocktype {
}
}
}
if (!empty($values['folder'])) {
$folder = artefact_instance_from_id($values['folder']);
if (!($folder instanceof ArtefactTypeFolder) || !$USER->can_publish_artefact($folder)) {
$result['message'] = get_string('unrecoverableerror', 'error');
$form->set_error(null, $result['message']);
$form->reply(PIEFORM_ERR, $result);
}
}
}
public static function instance_config_save($values) {
......
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