Skip to content

Commit

Permalink
Fixed issue: It's possible that a survey has no survey group in permi…
Browse files Browse the repository at this point in the history
…ssion check
  • Loading branch information
olleharstedt committed Nov 4, 2021
1 parent d864102 commit 663676a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion application/models/Survey.php
Expand Up @@ -2268,7 +2268,8 @@ public function hasPermission($sPermission, $sCRUD = 'read', $iUserID = null)
return true;
}
/* Inherited by SurveysInGroup */
if (SurveysInGroup::model()->findByPk($this->gsid)->hasPermission('surveys', $sGlobalCRUD, $iUserID)) {
$sig = SurveysInGroup::model()->findByPk($this->gsid);
if ($sig && $sig->hasPermission('surveys', $sGlobalCRUD, $iUserID)) {
return true;
}
return Permission::model()->hasPermission($this->getPrimaryKey(), 'survey', $sPermission, $sCRUD, $iUserID);
Expand Down

0 comments on commit 663676a

Please sign in to comment.