mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FEATURE: #3610 - Require ADMIN permissions for ?flush=all
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@72763 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ad063f6106
commit
43f62244df
@ -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 "";
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user