mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
commit
ab9e0286f0
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user