﻿<?xml version="1.0" encoding="utf-8"?><Type Name="IPermission" FullName="System.Security.IPermission" FullNameSP="System_Security_IPermission" Maintainer="ecma"><TypeSignature Language="ILASM" Value=".class interface public abstract IPermission" /><TypeSignature Language="C#" Value="public interface IPermission : System.Security.ISecurityEncodable" /><TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract IPermission implements class System.Security.ISecurityEncodable" /><MemberOfLibrary>BCL</MemberOfLibrary><AssemblyInfo><AssemblyName>mscorlib</AssemblyName><AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ]</AssemblyPublicKey><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Interfaces><Interface><InterfaceName>System.Security.ISecurityEncodable</InterfaceName></Interface></Interfaces><Attributes><Attribute><AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName></Attribute></Attributes><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>Permissions in the common language runtime are objects that describe sets of operations that can be secured for specified resources. A permission object describes operations or access that is subject to security control; it does not represent access or a right to perform operations. Permissions are used by both application code and the .NET Framework security system in the following ways.</para><list type="bullet"><item><para>Code requests the permissions it needs in order to run.</para></item><item><para>The security system policy grants permissions to code in order for it to run.</para></item><item><para>Code demands that calling code has a permission.</para></item><item><para>Code overrides the security stack using assert/deny/permit-only.</para></item></list><block subset="none" type="note"><para>If you write a new permission, you must implement this interface in your class.</para></block><block subset="none" type="note"><para>A permission can be accessed by multiple threads. When implementing this interface, you must guarantee that the <see cref="M:System.Security.IPermission.IsSubsetOf(System.Security.IPermission)" />, <see cref="M:System.Security.IPermission.Intersect(System.Security.IPermission)" />, <see cref="M:System.Security.IPermission.Union(System.Security.IPermission)" />, and <see cref="M:System.Security.IPermission.Copy" /> method implementations are thread safe. </para></block></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Defines methods implemented by permission types.</para></summary></Docs><Members><Member MemberName="Copy"><MemberSignature Language="ILASM" Value=".method public hidebysig virtual abstract class System.Security.IPermission Copy()" /><MemberSignature Language="C#" Value="public System.Security.IPermission Copy ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Security.IPermission Copy() cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Security.IPermission</ReturnType></ReturnValue><Parameters /><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>A copy of a permission represents the same access to resources as the original permission.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Creates and returns an identical copy of the current permission.</para></summary><returns><attribution license="cc4" from="Microsoft" modified="false" /><para>A copy of the current permission.</para></returns></Docs><Excluded>0</Excluded></Member><Member MemberName="Demand"><MemberSignature Language="ILASM" Value=".method public hidebysig virtual abstract void Demand()" /><MemberSignature Language="C#" Value="public void Demand ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Demand() cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters /><Docs><exception cref="T:System.Security.SecurityException"><para> A caller does not have the permission specified by the current instance.</para></exception><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>This method is typically used by secure libraries to ensure that callers have permission to access a resource. For example, a file class in a secure class library calls <see cref="M:System.Security.CodeAccessPermission.Demand" /> for the necessary <see cref="T:System.Security.Permissions.FileIOPermission" /> before performing a file operation requested by the caller.</para><para>Although the majority of the classes that implement this interface method satisfy the security criteria by performing a full stack walk, a stack walk is not necessarily performed. An example of an implementation that does not perform a stack walk is <see cref="M:System.Security.Permissions.PrincipalPermission.Demand" />.</para><para>When a stack walk is performed, the permissions of the code that calls this method are not examined; the check begins from the immediate caller of that code and proceeds up the stack. The call stack is typically represented as growing down, so that methods higher in the call stack call methods lower in the call stack. <see cref="M:System.Security.CodeAccessPermission.Demand" /> succeeds only if no <see cref="T:System.Security.SecurityException" /> is raised.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Throws a <see cref="T:System.Security.SecurityException" /> at run time if the security requirement is not met.</para></summary></Docs><Excluded>0</Excluded></Member><Member MemberName="Intersect"><MemberSignature Language="ILASM" Value=".method public hidebysig virtual abstract class System.Security.IPermission Intersect(class System.Security.IPermission target)" /><MemberSignature Language="C#" Value="public System.Security.IPermission Intersect (System.Security.IPermission target);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Security.IPermission Intersect(class System.Security.IPermission target) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Security.IPermission</ReturnType></ReturnValue><Parameters><Parameter Name="target" Type="System.Security.IPermission" /></Parameters><Docs><exception cref="T:System.ArgumentException"><paramref name="target" /> is not <see langword="null" /> and is not of the same type as the current instance.</exception><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>The intersection of two permissions is a permission that describes the set of operations they both describe in common. Only a demand that passes both original permissions will pass the intersection.</para><para>The following statements are required to be true for all implementations of the <see cref="M:System.Security.IPermission.Intersect(System.Security.IPermission)" /> method. <paramref name="X" /> and <paramref name="Y" /> represent <see cref="T:System.Security.IPermission" /> object references that are not null.</para><list type="bullet"><item><para><paramref name="X" />.Intersect(<paramref name="X" />) returns a value equal to <paramref name="X" />.</para></item><item><para><paramref name="X" />.Intersect(<paramref name="Y" />) returns the same value as <paramref name="Y" />.Intersect(<paramref name="X" />).</para></item><item><para><paramref name="X" />.Intersect(null) returns null.</para></item></list></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Creates and returns a permission that is the intersection of the current permission and the specified permission.</para></summary><returns><attribution license="cc4" from="Microsoft" modified="false" /><para>A new permission that represents the intersection of the current permission and the specified permission. This new permission is null if the intersection is empty.</para></returns><param name="target"><attribution license="cc4" from="Microsoft" modified="false" />A permission to intersect with the current permission. It must be of the same type as the current permission. </param></Docs><Excluded>0</Excluded></Member><Member MemberName="IsSubsetOf"><MemberSignature Language="ILASM" Value=".method public hidebysig virtual abstract bool IsSubsetOf(class System.Security.IPermission target)" /><MemberSignature Language="C#" Value="public bool IsSubsetOf (System.Security.IPermission target);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool IsSubsetOf(class System.Security.IPermission target) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Boolean</ReturnType></ReturnValue><Parameters><Parameter Name="target" Type="System.Security.IPermission" /></Parameters><Docs><exception cref="T:System.ArgumentException"><paramref name="target" /> is not <see langword="null" /> and is not of the same type as the current instance. </exception><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>The current permission is a subset of the specified permission if the current permission specifies a set of operations that is wholly contained by the specified permission. For example, a permission that represents access to C:\example.txt is a subset of a permission that represents access to C:\. If this method returns true, the current permission represents no more access to the protected resource than does the specified permission.</para><para>The following statements are required to be true for all implementations of the <see cref="M:System.Security.IPermission.IsSubsetOf(System.Security.IPermission)" /> method. <paramref name="X" />, <paramref name="Y" />, and <paramref name="Z" /> represent <see cref="T:System.Security.IPermission" /> objects that are not null.</para><list type="bullet"><item><para><paramref name="X" />.IsSubsetOf(<paramref name="X" />) returns true.</para></item><item><para><paramref name="X" />.IsSubsetOf(<paramref name="Y" />) returns the same value as <paramref name="Y" />.IsSubsetOf(<paramref name="X" />) if and only if <paramref name="X" /> and <paramref name="Y" /> represent the same set of permissions.</para></item><item><para>If <paramref name="X" />.IsSubsetOf(<paramref name="Y" />) and <paramref name="Y" />.IsSubsetOf(<paramref name="Z" />) both return true, <paramref name="X" />.IsSubsetOf(<paramref name="Z" />) returns true.</para></item></list><para>If <paramref name="X" /> represents an empty <see cref="T:System.Security.IPermission" /> object with a permission state of <see cref="F:System.Security.Permissions.PermissionState.None" /> and <paramref name="Y" /> represents an <see cref="T:System.Security.IPermission" /> object that is null, <paramref name="X" />.IsSubsetOf(<paramref name="Y" />) returns true. If <paramref name="Z" /> is also an empty permission, the compound set operation <paramref name="X" />.Union(Z).IsSubsetOf(Y) also returns true because the union of two empty permissions is an empty permission.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Determines whether the current permission is a subset of the specified permission.</para></summary><returns><attribution license="cc4" from="Microsoft" modified="false" /><para>true if the current permission is a subset of the specified permission; otherwise, false.</para></returns><param name="target"><attribution license="cc4" from="Microsoft" modified="false" />A permission that is to be tested for the subset relationship. This permission must be of the same type as the current permission. </param></Docs><Excluded>0</Excluded></Member><Member MemberName="Union"><MemberSignature Language="ILASM" Value=".method public hidebysig virtual abstract class System.Security.IPermission Union(class System.Security.IPermission target)" /><MemberSignature Language="C#" Value="public System.Security.IPermission Union (System.Security.IPermission target);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Security.IPermission Union(class System.Security.IPermission target) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Security.IPermission</ReturnType></ReturnValue><Parameters><Parameter Name="target" Type="System.Security.IPermission" /></Parameters><Docs><exception cref="T:System.ArgumentException"><paramref name="target" /> is not <see langword="null" /> and is not of the same type as the current instance. </exception><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>The result of a call to <see cref="M:System.Security.IPermission.Union(System.Security.IPermission)" /> is a permission that represents all the operations represented by both the current permission and the specified permission. Any demand that passes either permission passes their union.</para><para>The following statements are required to be true for all implementations of the <see cref="M:System.Security.IPermission.Union(System.Security.IPermission)" /> method. <paramref name="X" /> and <paramref name="Y" /> represent <see cref="T:System.Security.IPermission" /> objects that are not null.</para><list type="bullet"><item><para><paramref name="X" />.Union(<paramref name="X" />) returns an object that has the same value as <paramref name="X" />.</para></item><item><para><paramref name="X" />.Union(<paramref name="Y" />) returns an object that has the same value as the object returned by <paramref name="Y" />.Union(<paramref name="X" />).</para></item><item><para><paramref name="X" />.Union(null) returns an object that has the same value as <paramref name="X" />.</para></item></list></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Creates a permission that is the union of the current permission and the specified permission.</para></summary><returns><attribution license="cc4" from="Microsoft" modified="false" /><para>A new permission that represents the union of the current permission and the specified permission.</para></returns><param name="target"><attribution license="cc4" from="Microsoft" modified="false" />A permission to combine with the current permission. It must be of the same type as the current permission. </param></Docs><Excluded>0</Excluded></Member></Members><TypeExcluded>0</TypeExcluded></Type>