Skip to content

Commit

Permalink
fixed issue #08703: Owner of a survey have no rigth on this survey
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Feb 13, 2014
1 parent 2d7ee5d commit 5b05a17
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions application/models/Permission.php
Expand Up @@ -335,13 +335,13 @@ function hasPermission($iEntityID, $sEntityName, $sPermission, $sCRUD, $iUserID=
if (!Yii::app()->user->getIsGuest()) $iUserID = Yii::app()->session['loginID'];
else return false;
}

if ($iEntityID>0 && $sEntityName=='survey')
{
$thissurvey=getSurveyInfo($iEntityID);
if (!$thissurvey) return false;
$aSurveyInfo=getSurveyInfo($iEntityID);// OR find but then don't use $static
if (!$aSurveyInfo) return false;
// If you own a survey you have access to the whole survey
if ($iEntityID==$thissurvey['owner_id']) return true;
if ($iUserID==$aSurveyInfo['owner_id']) return true;
}

// Check if superadmin and cache it
Expand All @@ -356,7 +356,7 @@ function hasPermission($iEntityID, $sEntityName, $sPermission, $sCRUD, $iUserID=
else
{
$bPermission=true;
}
}
$aPermissionCache[0]['global'][$iUserID]['superadmin']['read_p']= $bPermission;
}

Expand Down

0 comments on commit 5b05a17

Please sign in to comment.