Commit 3f58d9b1 authored by Aaron Wells's avatar Aaron Wells Committed by Gerrit Code Review
Browse files

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 28889290
...@@ -579,6 +579,15 @@ class PluginBlocktypeGallery extends PluginBlocktype { ...@@ -579,6 +579,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) { 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