public static function aclCheck($user, $authOption, $forum)
{
$groupIds = $user->groupIds();
$authOptionId = AuthOption::where('auth_option', $authOption)->value('auth_option_id');
// the group may contain direct acl entry
$isAuthorized = static::directAcl($groupIds, $authOptionId)->where('forum_id', $forum->forum_id)->exists();
// the group may also be part of role which may have matching
// acl entry
if (!$isAuthorized) {
$isAuthorized = static::roleAcl($groupIds, $authOptionId)->where('forum_id', $forum->forum_id)->exists();
}
// there's actually another one (phpbb_acl_users) but doesn't seem
// to contain anything but old-ish banlist?
return $isAuthorized;
}