/** * Method to test whether a record can be deleted. * Defaults to the permission set in the component. * * @param object A record object. * * @return boolean True if allowed to delete the record. */ protected function canDelete($record) { if (empty($record->id)) { return parent::canDelete($record); } return JFactory::getUser()->authorise('core.delete', 'com_pfrepo.file.' . (int) $record->parent_id); }