module.exports = (title, msg, data, req, success = true) => {
    return {
        success: success,
        title: title,
        msg: msg,
        data: data,
        isLoggedIn: req.session?.loggedIn,
        userData: {
            id: req.session?.userId,
            name: req.session?.name,
            acl: req.session?.userAcl,
            groups: req.session?.userGroups,
            entities: req.session?.entities,
            tax: req.session?.tax
        }
    }
}