Commit e535179c authored by Kevin Dibble's avatar Kevin Dibble Committed by Robert Lyon

bug 1798203: Peer review prevents viewing objectionable content

Updated view to allow the user admin to view content if it has
reported objectionable content.

behatnotneeded

Change-Id: I277902b5a6121c5daaa6f692dcc391e9ef99caf8
(cherry picked from commit 39d44286)
parent 89f99fac
......@@ -1178,6 +1178,10 @@ class BlockInstance {
$classname = generate_class_name('blocktype', $this->get('blocktype'));
$displayforrole = call_static_method($classname, 'display_for_roles', $user_roles);
$checkview = $this->get_view();
if ($USER->is_admin_for_user($checkview->get('owner')) && $checkview->is_objectionable()) {
$displayforrole = true;
}
if (!$displayforrole) {
$content = '';
$smarty->assign('loadbyajax', false);
......
......@@ -333,7 +333,8 @@ if ($owner && $owner == $USER->get('id')) {
// Don't show page content to a user with peer role
// if the view doesn't have a peer assessment block
if (!$USER->has_peer_role_only($view) || $view->has_peer_assessement_block()) {
if (!$USER->has_peer_role_only($view) || $view->has_peer_assessement_block()
|| ($USER->is_admin_for_user($view->get('owner')) && $view->is_objectionable())) {
$viewcontent = $view->build_rows(); // Build content before initialising smarty in case pieform elements define headers.
}
......
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