public void None () { SqlClientPermission perm = new SqlClientPermission (PermissionState.None); Check ("None-1", perm, false, false, 0); perm.AllowBlankPassword = true; Check ("None-2", perm, true, false, 0); SqlClientPermission copy = (SqlClientPermission)perm.Copy (); Check ("Copy_None-1", copy, true, false, 0); copy.AllowBlankPassword = false; Check ("Copy_None-2", copy, false, false, 0); }
public void Unrestricted () { SqlClientPermission perm = new SqlClientPermission (PermissionState.Unrestricted); Check ("Unrestricted-1", perm, false, true, 0); perm.AllowBlankPassword = true; Check ("Unrestricted-2", perm, true, true, 0); SqlClientPermission copy = (SqlClientPermission)perm.Copy (); // note: Unrestricted is always created with default values (so AllowBlankPassword is false) Check ("Copy_Unrestricted-1", copy, false, true, 0); copy.AllowBlankPassword = true; Check ("Copy_Unrestricted-2", copy, true, true, 0); }
public void None_Childs () { SqlClientPermission perm = new SqlClientPermission (PermissionState.None); perm.Add ("data source=localhost;", String.Empty, KeyRestrictionBehavior.AllowOnly); perm.Add ("data source=127.0.0.1;", "password=;", KeyRestrictionBehavior.PreventUsage); Check ("None-Childs-1", perm, false, false, 2); perm.AllowBlankPassword = true; Check ("None-Childs-2", perm, true, false, 2); SqlClientPermission copy = (SqlClientPermission)perm.Copy (); Check ("Copy_None-Childs-1", copy, true, false, 2); copy.AllowBlankPassword = false; Check ("Copy_None-Childs-2", copy, false, false, 2); }