public bool IsEnabledForUser(IFeatureUser user) { if (FeatureSwitchStatus == FeatureSwitchStatus.Disabled) { return(false); } if (FeatureSwitchStatus == FeatureSwitchStatus.EnabledForAll) { return(true); } if (FeatureSwitchStatus == FeatureSwitchStatus.EnabledForAuthenticatedUsers) { if (user != null) { return(true); } return(false); } if (FeatureSwitchStatus == FeatureSwitchStatus.EnabledForSpecifiedUsersOrGroups) { if (EnabledForUsers.Any(o => o == user.Username)) { return(true); } if (EnabledForGroups.Any(o => user.Groups.Any(i => i == o))) { return(true); } return(false); } return(false); }
public bool Check(Feature feature, IFeatureUser user) { if (_checkers.ContainsKey(feature)) { return _checkers[feature].Any(c => c.Check(feature, user)); } return false; }
public bool Check(Feature feature, IFeatureUser user) { this.CheckCount++; this.Checked = feature; return _passed; }
public bool Check(Feature feature, IFeatureUser user) { return false; }
public bool IsEnabledForUser(IFeatureUser user) { if (FeatureSwitchStatus == FeatureSwitchStatus.Disabled) return false; if (FeatureSwitchStatus == FeatureSwitchStatus.EnabledForAll) return true; if (FeatureSwitchStatus == FeatureSwitchStatus.EnabledForAuthenticatedUsers) { if (user != null) return true; return false; } if (FeatureSwitchStatus == FeatureSwitchStatus.EnabledForSpecifiedUsersOrGroups) { if (EnabledForUsers.Any(o => o == user.Username)) return true; if (EnabledForGroups.Any(o => user.Groups.Any(i => i == o))) return true; return false; } return false; }
public bool Check(Feature feature, IFeatureUser user) { return _cultures.Contains(user.Culture); }
public static bool IsEnabled(this Feature feature, IFeatureUser user) { return Checker.Check(feature, user); }
public bool Check(Feature feature, IFeatureUser user) { return _d100.Next(0, 99) < _percent; }