Пример #1
0
        public bool IsAvailable(IPrincipal user)
        {
            var context = new PreviewCriteriaContext {
                Time = DateTime.Now, User = user
            };

            return(IsAvailable(context));
        }
Пример #2
0
        public bool IsAvailable()
        {
            var context = new PreviewCriteriaContext {
                Time = DateTime.Now
            };

            return(IsAvailable(context));
        }
Пример #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);
        }
Пример #4
0
 public static bool IsPreviewUser(PreviewCriteriaContext context)
 {
     return(context.User.IsInRole("PreviewUser"));
 }
Пример #5
0
 public static bool IsPowerUser(PreviewCriteriaContext context)
 {
     return(PowerUsers.Contains(context.User.Identity.Name));
 }
Пример #6
0
 private bool DependenciesAvailable(PreviewCriteriaContext context)
 {
     return(_dependencies.All(feature => feature.IsAvailable(context)));
 }