Skip to content

Commit

Permalink
Merge pull request #101 from mambax7/feature/check_for_permissionHandle
Browse files Browse the repository at this point in the history
feature/if there is no permissionHandler, it crashes
  • Loading branch information
geekwright authored Oct 2, 2023
2 parents 6cb3473 + 6c4bf3a commit 2844df8
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/Module/Helper/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,17 @@ public function checkPermission($gperm_name, $gperm_itemid, $trueifadmin = true)
$gperm_itemid = (int) $gperm_itemid;
$gperm_groupid = $this->getUserGroups();

return $this->permissionHandler->checkRight(
$gperm_name,
$gperm_itemid,
$gperm_groupid,
$this->mid,
(bool) $trueifadmin
);
if ($this->permissionHandler) {
return $this->permissionHandler->checkRight(
$gperm_name,
$gperm_itemid,
$gperm_groupid,
$this->mid,
(bool)$trueifadmin
);
} else {
return false;
}
}

/**
Expand Down

0 comments on commit 2844df8

Please sign in to comment.