Merge pull request #121 from halkyon/permission_fixes_non_admin

BUG Fixing non-ADMIN permission to view SubmittedForm/SubmittedFormField
This commit is contained in:
Will Rossiter 2013-04-30 16:43:32 -07:00
commit 869d457417
2 changed files with 55 additions and 1 deletions

View File

@ -70,6 +70,33 @@ class SubmittedForm extends DataObject {
return $fields;
}
/**
* @param Member
*
* @return boolean
*/
public function canView($member = null) {
return $this->Parent()->canView();
}
/**
* @param Member
*
* @return boolean
*/
public function canEdit($member = null) {
return $this->Parent()->canEdit();
}
/**
* @param Member
*
* @return boolean
*/
public function canDelete($member = null) {
return $this->Parent()->canDelete();
}
/**
* Before we delete this form make sure we delete all the
* field values so that we don't leave old data round
@ -85,4 +112,4 @@ class SubmittedForm extends DataObject {
parent::onBeforeDelete();
}
}
}

View File

@ -22,6 +22,33 @@ class SubmittedFormField extends DataObject {
'FormattedValue' => 'Value'
);
/**
* @param Member
*
* @return boolean
*/
public function canView($member = null) {
return $this->Parent()->canView();
}
/**
* @param Member
*
* @return boolean
*/
public function canEdit($member = null) {
return $this->Parent()->canEdit();
}
/**
* @param Member
*
* @return boolean
*/
public function canDelete($member = null) {
return $this->Parent()->canDelete();
}
/**
* Generate a formatted value for the reports and email notifications.
* Converts new lines (which are stored in the database text field) as