Merge pull request #2051 from kinglozzer/candelete-gridfield-fix

Fix: Enable delete button for users with canDelete() but no canEdit() permissions
This commit is contained in:
Ingo Schommer 2013-06-12 02:10:41 -07:00
commit ab9e0286f0

View File

@ -381,6 +381,10 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler {
if($this->record->ID && !$canEdit) {
// Restrict editing of existing records
$form->makeReadonly();
// Hack to re-enable delete button if user can delete
if ($canDelete) {
$form->Actions()->fieldByName('action_doDelete')->setReadonly(false);
}
} elseif(!$this->record->ID && !$canCreate) {
// Restrict creation of new records
$form->makeReadonly();