From 59ab073df2b01cfbbd333287dd0da11e08055fe8 Mon Sep 17 00:00:00 2001 From: Cecilia Vela Gurovic Date: Thu, 2 May 2019 15:02:05 +1200 Subject: [PATCH] Bug 1824767: site template should not have the edit access section behatnotneeded Change-Id: I40553bc4ebf69eef950f1c170d442aa7a963efe0 (cherry picked from commit 0e1d50d422e43e93addc46411fee5374617b03dd) --- htdocs/theme/raw/templates/view/editviewtabs.tpl | 2 +- htdocs/view/access.php | 3 +++ htdocs/view/accessurl.php | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/raw/templates/view/editviewtabs.tpl b/htdocs/theme/raw/templates/view/editviewtabs.tpl index dd7089090c..c4c34ea2fc 100644 --- a/htdocs/theme/raw/templates/view/editviewtabs.tpl +++ b/htdocs/theme/raw/templates/view/editviewtabs.tpl @@ -9,7 +9,7 @@ {str tag=editcontent1 section=view} - {if !$accesssuspended && ($edittitle || $viewtype == 'share')} + {if !$accesssuspended && ($edittitle || $viewtype == 'share') && !$issitetemplate} {str tag=shareview1 section=view} diff --git a/htdocs/view/access.php b/htdocs/view/access.php index 0cc04356d8..f4e03f0f92 100644 --- a/htdocs/view/access.php +++ b/htdocs/view/access.php @@ -53,6 +53,9 @@ if (!$USER->can_edit_view($view)) { if ($group && !group_within_edit_window($group)) { throw new AccessDeniedException(); } +if ($view->get('template') == View::SITE_TEMPLATE) { + throw new AccessDeniedException(); +} $form = array( diff --git a/htdocs/view/accessurl.php b/htdocs/view/accessurl.php index 389bfe190f..898b985b6e 100644 --- a/htdocs/view/accessurl.php +++ b/htdocs/view/accessurl.php @@ -59,7 +59,9 @@ if (!$USER->can_edit_view($view)) { if ($group && !group_within_edit_window($group)) { throw new AccessDeniedException(); } - +if ($view->get('template') == View::SITE_TEMPLATE) { + throw new AccessDeniedException(); +} $form = array( 'name' => 'accessurl', -- GitLab