MINOR Removing class comparison in SiteTree->canCreate() (mainly in order to enable overloading via SiteTreeSubsite->canCreate())

This commit is contained in:
Ingo Schommer 2011-08-30 19:00:46 +02:00
parent 4903fad537
commit 45f857e042

View File

@ -2302,7 +2302,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$result = array(); $result = array();
foreach($classes as $class) { foreach($classes as $class) {
$instance = singleton($class); $instance = singleton($class);
if((($instance instanceof HiddenClass) || !$instance->canCreate()) && ($class != $this->class)) continue; if((($instance instanceof HiddenClass) || !$instance->canCreate())) continue;
if($perms = $instance->stat('need_permission')) { if($perms = $instance->stat('need_permission')) {
if(!$this->can($perms)) continue; if(!$this->can($perms)) continue;