access_by_lua_block {
    -- check portal access rules and exit if access is restricted
    if require("skynet.account").is_access_unauthorized() then
        return require("skynet.account").exit_access_unauthorized()
    end

    -- check if portal is in subscription only mode
    if require("skynet.account").is_access_forbidden() then
        return require("skynet.account").exit_access_forbidden()
    end
}
