mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-07 00:28:55 +02:00
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:
parent
9ae437e577
commit
7a35596c28
@ -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();
|
parent::onBeforeWrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user