API CHANGE: If you can't create a given dataobject type, then don't show an import form in modeladmin

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@84521 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-08-17 05:26:34 +00:00
parent 15d75ad293
commit 9fbce63fa9

View File

@ -425,6 +425,8 @@ class ModelAdmin_CollectionController extends Controller {
$importers = $this->parentController->getModelImporters(); $importers = $this->parentController->getModelImporters();
if(!$importers || !isset($importers[$modelName])) return false; if(!$importers || !isset($importers[$modelName])) return false;
if(!singleton($modelName)->canCreate(Member::currentUser())) return false;
$fields = new FieldSet( $fields = new FieldSet(
new HiddenField('ClassName', _t('ModelAdmin.CLASSTYPE'), $modelName), new HiddenField('ClassName', _t('ModelAdmin.CLASSTYPE'), $modelName),
new FileField('_CsvFile', false) new FileField('_CsvFile', false)