diff --git a/core/SSViewer.php b/core/SSViewer.php index c195c5b4c..1efe3c618 100644 --- a/core/SSViewer.php +++ b/core/SSViewer.php @@ -121,7 +121,12 @@ class SSViewer extends Object { // flush template manifest cache if requested if (isset($_GET['flush']) && $_GET['flush'] == 'all') { - self::flush_template_cache(); + if(Director::isDev() || Permission::check('ADMIN')) { + self::flush_template_cache(); + Debug::message('flushed!'); + } else { + Security::permissionFailure(null, 'Please log in as an administrator to flush the template cache.'); + } } if(substr((string) $templateList,-3) == '.ss') { @@ -591,4 +596,4 @@ function supressOutput() { return ""; } -?> \ No newline at end of file +?>