Commit 4dc2d489 authored by Robert Lyon's avatar Robert Lyon

Bug 1688165: Checking if user can view group hompage for embedded images

Rather than checking if user has a group role.
As the embedding of images for group description is linked to the
group homepage, so if you can see that you should be allowed to see
the embedded images within it.


Change-Id: I81cbe5cff7229967095a6e2293576861202432c0
Signed-off-by: Robert Lyon's avatarRobert Lyon <>
parent c99a3f41
......@@ -141,8 +141,10 @@ else {
if (!$imagevisible && $groupid) {
// check for public embedded image
if (!group_user_access($groupid)){
// Check if group description is viewable
$view = group_get_homepage_view($groupid);
if (!can_view_view($view->get('id'))) {
throw new AccessDeniedException(get_string('accessdenied', 'error'));
$imagevisible = EmbeddedImage::can_see_embedded_image($fileid, 'group', $groupid);
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