customerAccountManagement = $customerAccountManagement; } /** * Get button data. * * @return array */ public function getButtonData() { $customerId = $this->getCustomerId(); $canModify = $customerId && !$this->customerAccountManagement->isReadonly($this->getCustomerId()); $data = []; if ($customerId && $canModify) { $data = [ 'label' => __('Delete Customer'), 'class' => 'delete', 'id' => 'customer-edit-delete-button', 'data_attribute' => [ 'url' => $this->getDeleteUrl() ], 'on_click' => '', 'sort_order' => 20, 'aclResource' => 'Magento_Customer::delete', ]; } return $data; } /** * Get delete url. * * @return string */ public function getDeleteUrl() { return $this->getUrl('*/*/delete', ['id' => $this->getCustomerId()]); } }