Beispiel #1
0
        static AuthroziedFeatureInfo GetAuthorizationInfo(ClaimsPrincipal user, Feature feature)
        {
            if (user.CanSee(feature))
            {
                return new AuthroziedFeatureInfo {
                           Feature = feature
                }
            }
            ;

            var hasPermittedChildNodes = feature.GetAllChildren().Cast <Feature>().Any(c => user.CanSee(c));

            if (hasPermittedChildNodes)
            {
                return new AuthroziedFeatureInfo {
                           Feature = feature, IsDisabled = true
                }
            }
            ;

            return(null);
        }
    }
}