public void CheckRoles(out string friendlyMessage, UserType user, string username)
        {
            try {
                bool hasLogRole = false, owner = false, canRead = false, canWrite = false;
                bool hasAccessAdmin = false, hasDDLAdmin = false, hasSecurityAdmin = false;
                var  config = ((TwoUserDatabaseConfiguration)uiConfiguration).RuntimeDatabaseConfiguration(user);
                try {
                    ConfigurationManagerUtils.GetDBUserRoles(username, ref hasLogRole, ref owner, ref canRead, ref canWrite, ref hasAccessAdmin, ref hasDDLAdmin, ref hasSecurityAdmin, config);
                    if (!owner)
                    {
                        if (!CheckDBRolesForUserType(user, username, canRead, canWrite, hasAccessAdmin, hasSecurityAdmin, hasDDLAdmin, hasLogRole, out friendlyMessage))
                        {
                            return;
                        }
                    }

                    if (!ConfigurationManagerUtils.CheckHubServerVersion(this, config, out friendlyMessage))
                    {
                        return;
                    }
                } catch {
                    friendlyMessage = "Database connection was successful.\r\n\r\nHowever, it was not possible to read the schema version. This may be because the schema has not been created yet.";
                    return;
                }
            } catch (Exception exception) {
                friendlyMessage = "Database connection was successful.\r\n\r\nHowever the following error ocurred while trying to read user permissions:\r\n\r\nFailed to retrieve user roles:\r\n\r\n" + exception.Message;
                return;
            }
            friendlyMessage = "Test completed successfully.";
        }