fix(Reorder): Changed $this->ID == 0 to !$this->exists() and added Controller::has_curr() check

This commit is contained in:
Jake Bentvelzen 2016-07-14 09:41:37 +10:00
parent 08d173f24a
commit 329ad80596

View File

@ -365,7 +365,7 @@ class EditableFormField extends DataObject {
$parent = $this->Parent();
if($parent && $parent->exists()) {
return $parent->canEdit($member) && !$this->isReadonly();
} else if ($this->ID == 0) {
} else if (!$this->exists() && Controller::has_curr()) {
// This is for GridFieldOrderableRows support as it checks edit permissions on
// singleton of the class. Allows editing of User Defined Form pages by
// 'Content Authors' and those with permission to edit the UDF page. (ie. CanEditType/EditorGroups)