mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
FEATURE: Allow file size/extension limits to apply to the admin user as
well. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@83631 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f1ab79384d
commit
f5908eb196
@ -28,6 +28,13 @@ class AssetAdmin extends LeftAndMain {
|
|||||||
*/
|
*/
|
||||||
public static $allowed_extensions = array();
|
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(
|
static $allowed_actions = array(
|
||||||
'addfolder',
|
'addfolder',
|
||||||
'deletefolder',
|
'deletefolder',
|
||||||
@ -196,7 +203,7 @@ JS
|
|||||||
}
|
}
|
||||||
|
|
||||||
// validate files (only if not logged in as admin)
|
// validate files (only if not logged in as admin)
|
||||||
if(Permission::check('ADMIN')) {
|
if(!self::$apply_restrictions_to_admin && Permission::check('ADMIN')) {
|
||||||
$valid = true;
|
$valid = true;
|
||||||
} else {
|
} else {
|
||||||
$upload = new Upload();
|
$upload = new Upload();
|
||||||
|
Loading…
Reference in New Issue
Block a user