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@84000 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Tom Rix 2009-08-06 23:31:16 +00:00
parent 7a35596c28
commit 5a7c217ea6

View File

@ -1214,7 +1214,7 @@ 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') {
if ($this->ID == 0 && $this->ParentID == 0 && $this->CanEditType == 'Inherit') {
$this->CanEditType = 'LoggedInUsers';
}