public ConfiguredFeaturesCollection GetFeatureFlags() { var features = _innerFeatureFlagProvider.GetFeatureFlags(); var currentUser = _currentUserProvider.GetCurrentUser(); // All admins get VenuesDataManagement if (currentUser.IsAdmin) { features = features.With(FeatureFlags.VenuesDataManagement); } // If the user is bound to a provider on the beta testers list, they get VenuesDataManagement if (currentUser.CurrentProviderUkprn.HasValue && _betaTestingProviderUkprns.Contains(currentUser.CurrentProviderUkprn.Value)) { features = features.With(FeatureFlags.VenuesDataManagement); } // If any of '{Courses|Venues}DataManagement' features are defined // then also define the root 'DataManagement' feature if (features.HaveFeature(FeatureFlags.CoursesDataManagement) || features.HaveFeature(FeatureFlags.VenuesDataManagement)) { features = features.With(FeatureFlags.DataManagement); } return(features); }
public ConfiguredFeaturesCollection GetFeatureFlags() { if (_overridenFeatures != null) { return(_overridenFeatures); } else { return(_inner.GetFeatureFlags()); } }
public ISet <string> GetFeatureFlags() { if (_overridenFeatures != null) { return(_overridenFeatures); } else { return(_inner.GetFeatureFlags()); } }
public IReadOnlyCollection <string> GetFeatureFlags() { if (_overridenFeatures != null) { return(_overridenFeatures); } else { return(_inner.GetFeatureFlags()); } }
public static bool HaveFeature(this IFeatureFlagProvider featureFlagProvider, string feature) => featureFlagProvider.GetFeatureFlags().Contains(feature);
public CanaryUserFeatureFlagProvider( IFeatureFlagProvider innerFeatureFlagProvider, ICurrentUserProvider currentUserProvider) { if (innerFeatureFlagProvider is null) { throw new ArgumentNullException(nameof(innerFeatureFlagProvider)); } if (currentUserProvider is null) { throw new ArgumentNullException(nameof(currentUserProvider)); } _featureFlags = new Lazy <IReadOnlyCollection <string> >(() => ResolveFeatureFlags(currentUserProvider.GetCurrentUser(), innerFeatureFlagProvider.GetFeatureFlags())); }
public static bool HaveFeature(this IFeatureFlagProvider featureFlagProvider, string feature) => featureFlagProvider.GetFeatureFlags().Contains(feature, StringComparer.OrdinalIgnoreCase);
public ConfiguredFeaturesCollection GetFeatureFlags() => ResolveFeatureFlags(_currentUserProvider.GetCurrentUser(), _innerFeatureFlagProvider.GetFeatureFlags());