BUGFIX prevent a nasty permissions situation where no one but an admin can edit a new page

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@83999 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Tom Rix 2009-08-06 23:30:17 +00:00
parent 9ae437e577
commit 7a35596c28

View File

@ -1211,6 +1211,13 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
}
}
// If this is a new page, it does not have a parent, and the edit type is
// set to inherit, change it to logged in users only (otherwise only admins
// will be able to edit it)
if (!$this->ID && !$this->ParentID && $this->CanEditType == 'Inherit') {
$this->CanEditType = 'LoggedInUsers';
}
parent::onBeforeWrite();
}