Esempio n. 1
0
        public bool IsAvailable(IPrincipal user)
        {
            var context = new PreviewCriteriaContext {
                Time = DateTime.Now, User = user
            };

            return(IsAvailable(context));
        }
Esempio n. 2
0
        public bool IsAvailable()
        {
            var context = new PreviewCriteriaContext {
                Time = DateTime.Now
            };

            return(IsAvailable(context));
        }
Esempio n. 3
0
        public bool IsAvailable(PreviewCriteriaContext context)
        {
            context.Feature = this;

            if (Flag == FeatureState.Established)
            {
                return(DependenciesAvailable(context));
            }

            if (Flag == FeatureState.Preview && PreviewCriteria != null)
            {
                return(DependenciesAvailable(context) && PreviewCriteria(context));
            }

            return(false);
        }
Esempio n. 4
0
 public static bool IsPreviewUser(PreviewCriteriaContext context)
 {
     return(context.User.IsInRole("PreviewUser"));
 }
Esempio n. 5
0
 public static bool IsPowerUser(PreviewCriteriaContext context)
 {
     return(PowerUsers.Contains(context.User.Identity.Name));
 }
Esempio n. 6
0
 private bool DependenciesAvailable(PreviewCriteriaContext context)
 {
     return(_dependencies.All(feature => feature.IsAvailable(context)));
 }