using Codelyzer.Analysis; using CTA.Rules.Common.WebConfigManagement; namespace CTA.FeatureDetection.AuthType.CompiledFeatures { public class FormsAuthenticationWithMembershipFeature : FormsAuthenticationFeature { /// /// Determines if Forms Authentication with Membership is being used in a given project based on /// Web.config settings. /// /// Qualifications: /// 1. Web.config uses Forms authentication and Membership: /// /// /// /// /// /// ... /// /// /// /// /// /// Source code analysis results /// Whether or not Forms Authentication with Membership is used public override bool IsPresent(AnalyzerResult analyzerResult) { var config = WebConfigManager.LoadWebConfigAsXDocument(analyzerResult.ProjectResult.ProjectRootPath); return base.IsPresent(analyzerResult) && config.ContainsElement(Constants.MembershipElementPath); } } }