private void ResolveDefaultRolesNode() { if ((securitySettings.DefaultRolesProviderName == null) || (securitySettings.DefaultRolesProviderName.Length == 0)) { return; } RolesProviderCollectionNode nodes = this.Hierarchy.FindNodeByType(this, typeof(RolesProviderCollectionNode)) as RolesProviderCollectionNode; Debug.Assert(nodes != null, "Could not find the RolesProviderCollectionNode"); DefaultRolesInstance = Hierarchy.FindNodeByName(nodes, securitySettings.DefaultRolesProviderName) as RolesProviderNode; }
private void GetRoleProviders() { RolesProviderCollectionNode rolesProviders = Hierarchy.FindNodeByType(typeof(RolesProviderCollectionNode)) as RolesProviderCollectionNode; if (rolesProviders == null) { return; } if (Object.ReferenceEquals(securitySettings.RolesProviders, rolesProviders.RolesProviderDataCollection)) { return; } securitySettings.RolesProviders.Clear(); foreach (RolesProviderData rolesProviderData in rolesProviders.RolesProviderDataCollection) { this.securitySettings.RolesProviders[rolesProviderData.Name] = rolesProviderData; } }