PolicyLevel.Resolve メソッド
アセンブリ: mscorlib (mscorlib.dll 内)

Dim instance As PolicyLevel Dim evidence As Evidence Dim returnValue As PolicyStatement returnValue = instance.Resolve(evidence)
戻り値
結果として得られる PolicyStatement。


Resolve は、ポリシー レベルに対する基本のポリシー評価の操作です。証拠のセットが入力として指定されると、このメソッドは、一致するコード グループのメンバシップ条件のテストをルートから開始します。一致するコード グループの結果のアクセス許可の組み合わせによって、返される PolicyStatement を生成します。
コードにアクセス許可を与える場合、セキュリティ ポリシーは、適用できるすべてのポリシー レベルの解決されたポリシー ステートメントを、アクセス許可のコード要求と共に使用します。

Resolve メソッドの使用方法を次のコード例に示します。このコード例は、PolicyLevel クラスのトピックで取り上げているコード例の一部分です。
' Demonstrate the use of ResolvePolicy for the supplied evidence and a specified policy level. Private Overloads Shared Sub CheckEvidence(ByVal pLevel As PolicyLevel, ByVal evidence As Evidence) ' Display the code groups to which the evidence belongs. Console.WriteLine(ControlChars.Tab + "ResolvePolicy for the given evidence: ") Dim codeGroup As IEnumerator = evidence.GetEnumerator() While codeGroup.MoveNext() Console.WriteLine((ControlChars.Tab + ControlChars.Tab + CType(codeGroup.Current, CodeGroup).Name)) End While Console.WriteLine("The current evidence belongs to the following root CodeGroup:") ' pLevel is the current PolicyLevel, evidence is the Evidence to be resolved. Dim cg1 As CodeGroup = pLevel.ResolveMatchingCodeGroups(evidence) Console.WriteLine((pLevel.Label + " Level")) Console.WriteLine((ControlChars.Tab + "Root CodeGroup = " + cg1.Name)) ' Show how Resolve is used to determine the set of permissions that ' the security system grants to code, based on the evidence. ' Show the granted permissions. Console.WriteLine(ControlChars.Lf + "Current permissions granted:") Dim pState As PolicyStatement = pLevel.Resolve(evidence) Console.WriteLine(pState.ToXml().ToString()) Return End Sub 'CheckEvidence
// Demonstrate the use of ResolvePolicy for the supplied evidence and a specified policy level. private static void CheckEvidence(PolicyLevel pLevel, Evidence evidence) { // Display the code groups to which the evidence belongs. Console.WriteLine("\tResolvePolicy for the given evidence: "); IEnumerator codeGroup = evidence.GetEnumerator(); while (codeGroup.MoveNext()) { Console.WriteLine("\t\t" + ((CodeGroup)codeGroup.Current).Name); } Console.WriteLine("The current evidence belongs to the following root CodeGroup:"); // pLevel is the current PolicyLevel, evidence is the Evidence to be resolved. CodeGroup cg1 = pLevel.ResolveMatchingCodeGroups(evidence); Console.WriteLine(pLevel.Label + " Level"); Console.WriteLine("\tRoot CodeGroup = " + cg1.Name); // Show how Resolve is used to determine the set of permissions that // the security system grants to code, based on the evidence. // Show the granted permissions. Console.WriteLine("\nCurrent permissions granted:"); PolicyStatement pState = pLevel.Resolve(evidence); Console.WriteLine(pState.ToXml().ToString()); return; }
// Demonstrate the use of ResolvePolicy for the supplied evidence and a specified policy level. void CheckEvidence( PolicyLevel^ pLevel, Evidence^ evidence ) { // Display the code groups to which the evidence belongs. Console::WriteLine( "\tResolvePolicy for the given evidence: " ); IEnumerator^ codeGroup = evidence->GetEnumerator(); while ( codeGroup->MoveNext() ) { Console::WriteLine( "\t\t{0}", (dynamic_cast<CodeGroup^>(codeGroup->Current))->Name ); } Console::WriteLine( "The current evidence belongs to the following root CodeGroup:" ); // pLevel is the current PolicyLevel, evidence is the Evidence to be resolved. CodeGroup^ cg1 = pLevel->ResolveMatchingCodeGroups( evidence ); Console::WriteLine( "{0} Level", pLevel->Label ); Console::WriteLine( "\tRoot CodeGroup = {0}", cg1->Name ); // Show how Resolve is used to determine the set of permissions that // the security system grants to code, based on the evidence. // Show the granted permissions. Console::WriteLine( "\nCurrent permissions granted:" ); PolicyStatement^ pState = pLevel->Resolve( evidence ); Console::WriteLine( pState->ToXml() ); return; }
// Demonstrate the use of ResolvePolicy for the supplied evidence and //a specified policy level. private static void CheckEvidence(PolicyLevel pLevel, Evidence evidence) { // Display the code groups to which the evidence belongs. Console.WriteLine("\tResolvePolicy for the given evidence: "); IEnumerator codeGroup = evidence.GetEnumerator(); while (codeGroup.MoveNext()) { Console.WriteLine(("\t\t" + ((CodeGroup) (codeGroup.get_Current())).get_Name())); } Console.WriteLine("The current evidence belongs to the " + "following root CodeGroup:"); // pLevel is the current PolicyLevel, evidence is the Evidence // to be resolved. CodeGroup cg1 = pLevel.ResolveMatchingCodeGroups(evidence); Console.WriteLine((pLevel.get_Label() + " Level")); Console.WriteLine(("\tRoot CodeGroup = " + cg1.get_Name())); // Show how Resolve is used to determine the set of permissions that // the security system grants to code, based on the evidence. // Show the granted permissions. Console.WriteLine("\nCurrent permissions granted:"); PolicyStatement pState = pLevel.Resolve(evidence); Console.WriteLine(pState.ToXml().ToString()); return; } //CheckEvidence

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からPolicyLevel.Resolve メソッドを検索する場合は、下記のリンクをクリックしてください。

- PolicyLevel.Resolve メソッドのページへのリンク