From c68e3f8875a6c7501dc98d318185f31bc35ed840 Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Tue, 11 Aug 2009 01:08:29 +0000 Subject: [PATCH] NOTFORMERGE: Merged r83631 from branches/2.3 git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@84119 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/AssetAdmin.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/AssetAdmin.php b/code/AssetAdmin.php index d43ac601..a780f900 100755 --- a/code/AssetAdmin.php +++ b/code/AssetAdmin.php @@ -28,6 +28,13 @@ class AssetAdmin extends LeftAndMain { */ public static $allowed_extensions = array(); + /** + * If this is true, then restrictions set in $allowed_max_file_size and + * $allowed_extensions will be applied to users with admin privileges as + * well. + */ + public static $apply_restrictions_to_admin = false; + static $allowed_actions = array( 'addfolder', 'deletefolder', @@ -191,7 +198,7 @@ JS } // validate files (only if not logged in as admin) - if(Permission::check('ADMIN')) { + if(!self::$apply_restrictions_to_admin && Permission::check('ADMIN')) { $valid = true; } else { $upload = new Upload();