This is a hack to entirely disable response editing. It needs to be tested and will be over-written on updates.
In
/application/models/Permission.php, find this function:
Code:
function hasSurveyPermission($iSurveyID,$sPermission, $sCRUD, $iUserID=null)
{
$oSurvey=Survey::Model()->findByPk($iSurveyID);
if (!$oSurvey)
return false;
$iUserID=self::getUserId($iUserID);
if(!$iUserID)
return false;
// If you own a survey you have access to the whole survey
if ($iUserID==$oSurvey->owner_id)
return true;
// Get global correspondance for surveys rigth
$sGlobalCRUD=($sCRUD=='create' || ($sCRUD=='delete' && $sPermission!='survey') ) ? 'update' : $sCRUD;
return $this->hasGlobalPermission('surveys', $sGlobalCRUD, $iUserID) || $this->hasPermission($iSurveyID, 'survey', $sPermission, $sCRUD, $iUserID);
}
And replace it with this:
Code:
function hasSurveyPermission($iSurveyID,$sPermission, $sCRUD, $iUserID=null)
{
$oSurvey=Survey::Model()->findByPk($iSurveyID);
if (!$oSurvey)
return false;
$iUserID=self::getUserId($iUserID);
if(!$iUserID)
return false;
// Entirely disable editing responses
if($sPermission == 'responses' && ($sCRUD == 'create' || $sCRUD == 'update' || $sCRUD == 'delete'))
return false;
// If you own a survey you have access to the whole survey
if ($iUserID==$oSurvey->owner_id)
return true;
// Get global correspondance for surveys rigth
$sGlobalCRUD=($sCRUD=='create' || ($sCRUD=='delete' && $sPermission!='survey') ) ? 'update' : $sCRUD;
return $this->hasGlobalPermission('surveys', $sGlobalCRUD, $iUserID) || $this->hasPermission($iSurveyID, 'survey', $sPermission, $sCRUD, $iUserID);
}