added a call to magic method to check extra (crm) permission

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@61578 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Saophalkun Ponlu 2008-08-27 01:56:37 +00:00
parent eea6cf978d
commit a009cf5341

View File

@ -168,7 +168,14 @@ abstract class ModelAdmin extends LeftAndMain {
$models = $this->getManagedModels();
$modelMap = array();
foreach($models as $modelName) {
if(singleton($modelName)->canCreate(Member::currentUser())) $modelMap[$modelName] = singleton($modelName)->singular_name();
if ($this->hasMethod('alternatePermissionCheck')) {
if ($this->alternatePermissionCheck()) {
$modelMap[$modelName] = singleton($modelName)->singular_name();
}
}
else {
if(singleton($modelName)->canCreate(Member::currentUser())) $modelMap[$modelName] = singleton($modelName)->singular_name();
}
}
$form = new Form(