Commit 04ef08d4 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic Committed by Robert Lyon
Browse files

Bug 1797294: Group admin has access to reported page

behatnotneeded

Change-Id: I62bd89b3dd63eac0fd6564cfc7eb2ac9b350286c
(cherry picked from commit 2c7e98c2)
parent c38a17ef
......@@ -88,7 +88,13 @@ if (!isset($view)) {
$is_admin = $USER->get('admin') || $USER->is_institutional_admin();
$is_owner = $view->get('owner') == $USER->get('id');
if (is_view_suspended($view) && !$is_admin && !$is_owner) {
// check if this is a group page and the user is group admin
if ($groupid = $view->get('group')) {
$is_group_admin = (group_user_access($groupid) == 'admin');
}
if (is_view_suspended($view) && !$is_admin && !$is_owner && !($groupid && $is_group_admin)) {
$errorstr = get_string('accessdeniedsuspension', 'error');
throw new AccessDeniedException($errorstr);
}
......
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