Skip to content

Commit

Permalink
Dev: allow guest to have survey rigths by plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Apr 9, 2015
1 parent 33bd4f7 commit d93e9f2
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions application/models/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,6 @@ function hasSurveyPermission($iSurveyID, $sPermission, $sCRUD='read', $iUserID=n
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;
Expand All @@ -609,20 +607,20 @@ function hasTemplatePermission($sTemplateName, $sCRUD='read', $iUserID=null)
}

/**
/* function used to order Permission by language string
/* @param aApermission array The first permission information
/* @param aBpermission array The second permission information
/* @return bool
* function used to order Permission by language string
* @param aApermission array The first permission information
* @param aBpermission array The second permission information
* @return bool
*/
private static function comparePermissionTitle($aApermission,$aBpermission)
{
return strcmp($aApermission['title'], $aBpermission['title']);
}

/**
/* get the default/fixed $iUserID
/* @param iUserID optionnal user id
/* @return integer user id
* get the default/fixed $iUserID
* @param iUserID optionnal user id
* @return integer user id
*/
private static function getUserId($iUserID=null)
{
Expand Down

0 comments on commit d93e9f2

Please sign in to comment.