public static void VerifyAccess(string key) { if (!AppSettings.Instance.RequireAccessKey) return; if (string.IsNullOrWhiteSpace(key) || !IsAllowed(key)) throw new ApplicationException("Wrong access key '" + key + "'"); }