aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2017-11-23 17:24:58 +0000
committerDave Arter <davea@mysociety.org>2017-11-24 13:56:46 +0000
commit794ab08b0a889011228a2e6041c336f87f8285f9 (patch)
tree6c7206e04c51a5363384c41d6794545b2d57ca77
parent1986cacd1518b876d11df31cde60b896d91a80cb (diff)
Reinstate appcache_enabled staging flag
This can optionally disable appcache for superusers which can be handy in development.
-rw-r--r--conf/general.yml-example3
-rw-r--r--perllib/FixMyStreet/App/Controller/Offline.pm3
2 files changed, 5 insertions, 1 deletions
diff --git a/conf/general.yml-example b/conf/general.yml-example
index d205061ef..79af1c78e 100644
--- a/conf/general.yml-example
+++ b/conf/general.yml-example
@@ -48,9 +48,12 @@ STAGING_SITE: 1
# this to 1 if you want a staging site to route reports as normal.
# - skip_checks: Manual testing of multiple cobrands can be made easier by
# skipping some checks they have in them, if this variable is set.
+# - enable_appcache: Whether the appcache should be active. NB: Only affects
+# superuser sessions.
STAGING_FLAGS:
send_reports: 0
skip_checks: 0
+ enable_appcache: 0
# What to use as front page/alert example places placeholder
# Defaults to High Street, Main Street
diff --git a/perllib/FixMyStreet/App/Controller/Offline.pm b/perllib/FixMyStreet/App/Controller/Offline.pm
index 7b17bb569..d50d0d03f 100644
--- a/perllib/FixMyStreet/App/Controller/Offline.pm
+++ b/perllib/FixMyStreet/App/Controller/Offline.pm
@@ -18,7 +18,8 @@ Offline pages Catalyst Controller.
sub have_appcache : Private {
my ($self, $c) = @_;
- return $c->user_exists && $c->user->has_body_permission_to('planned_reports');
+ return $c->user_exists && $c->user->has_body_permission_to('planned_reports')
+ && !($c->user->is_superuser && FixMyStreet->staging_flag('enable_appcache', 0));
}
sub manifest : Path("/offline/appcache.manifest") {