コード例 #1
0
        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;
        }
コード例 #2
0
        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;
            }
        }