Including canCreate in if statement so that button gets removed if user isn't to be able to create new records

This commit is contained in:
Rafael Marins de Sousa 2019-05-28 12:28:00 +12:00
parent abaeeb9432
commit f7c1be7ac1

View File

@ -323,7 +323,7 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler
$rightGroup->push($previousAndNextGroup);
if ($component && $component->getShowAdd()) {
if ($component && $component->getShowAdd() && $this->record->canCreate()) {
$rightGroup->push(
LiteralField::create(
'new-record',