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