1 <Type Name="EnvironmentPermissionAttribute" FullName="System.Security.Permissions.EnvironmentPermissionAttribute" FullNameSP="System_Security_Permissions_EnvironmentPermissionAttribute" Maintainer="ecma">
2 <TypeSignature Language="ILASM" Value=".class public sealed serializable EnvironmentPermissionAttribute extends System.Security.Permissions.CodeAccessSecurityAttribute" />
3 <TypeSignature Language="C#" Value="public sealed class EnvironmentPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute" />
4 <MemberOfLibrary>BCL</MemberOfLibrary>
6 <AssemblyName>mscorlib</AssemblyName>
7 <AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ]</AssemblyPublicKey>
8 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
9 <AssemblyVersion>2.0.0.0</AssemblyVersion>
10 <AssemblyVersion>4.0.0.0</AssemblyVersion>
12 <ThreadingSafetyStatement>All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.</ThreadingSafetyStatement>
14 <BaseTypeName>System.Security.Permissions.CodeAccessSecurityAttribute</BaseTypeName>
19 <AttributeName>System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.All, AllowMultiple=true, Inherited=false)</AttributeName>
22 <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
27 <para>Used to declaratively specify security actions to control
28 access to environment variables.</para>
31 <para>Environment variable names are case-insensitive. Multiple environment variable names are specified by separating the names
32 using the <see cref="F:System.IO.Path.PathSeparator" />
34 <block subset="none" type="note">
35 <para> The level of access to one or more environment variables is
36 specified using the members of the current instance. For example, to specify
37 read permissions for an environment variable, set the <see cref="P:System.Security.Permissions.EnvironmentPermissionAttribute.Read" /> property equal
38 to the name of the environment variable.</para>
39 <para> The security information declared by a security attribute is stored in the
40 metadata of the attribute target, and is accessed by the system at run-time.
41 Security attributes are used for declarative security only. For imperative
42 security, use the corresponding permission class, <see cref="T:System.Security.Permissions.EnvironmentPermission" />
44 <para>The allowable <see cref="T:System.Security.Permissions.EnvironmentPermissionAttribute" /> targets are determined by the
45 <see cref="T:System.Security.Permissions.SecurityAction" /> passed to the constructor.</para>
49 <para> The following example shows a declarative request for
50 the ability to read the specified environment variables. The <see cref="F:System.Security.Permissions.SecurityAction.RequestMinimum" />
51 security action indicates
52 that this is the minimum permission required for the target assembly to be able
55 <c>[assembly:EnvironmentPermissionAttribute(SecurityAction.RequestMinimum, Read="COMPUTERNAME;USERNAME;USERDOMAIN")]
58 <para>The following example shows how to demand that the
59 calling code has unrestricted access to all environment variables. Demands are
60 typically made in managed libraries to protect methods or classes from
61 malicious code.</para>
63 <c>[EnvironmentPermissionAttribute(SecurityAction.Demand, Unrestricted=true)]
69 <Member MemberName=".ctor">
70 <MemberSignature Language="ILASM" Value="public rtspecialname specialname instance void .ctor(valuetype System.Security.Permissions.SecurityAction action)" />
71 <MemberSignature Language="C#" Value="public EnvironmentPermissionAttribute (System.Security.Permissions.SecurityAction action);" />
72 <MemberType>Constructor</MemberType>
75 <Parameter Name="action" Type="System.Security.Permissions.SecurityAction" />
78 <param name="action">A <see cref="T:System.Security.Permissions.SecurityAction" /> value.</param>
80 <para>Constructs and initializes a new instance of the <see cref="T:System.Security.Permissions.EnvironmentPermissionAttribute" /> class
81 with the specified <see cref="T:System.Security.Permissions.SecurityAction" /> value.</para>
83 <remarks>To be added.</remarks>
84 <exception cref="T:System.ArgumentException">
85 <paramref name="action" /> is not a valid <see cref="T:System.Security.Permissions.SecurityAction" /> value. </exception>
87 <Excluded>0</Excluded>
89 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
90 <AssemblyVersion>2.0.0.0</AssemblyVersion>
91 <AssemblyVersion>4.0.0.0</AssemblyVersion>
94 <Member MemberName="All">
95 <MemberSignature Language="C#" Value="public string All { set; get; }" />
96 <MemberType>Property</MemberType>
98 <ReturnType>System.String</ReturnType>
101 <summary>To be added.</summary>
102 <value>To be added.</value>
103 <remarks>To be added.</remarks>
106 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
107 <AssemblyVersion>2.0.0.0</AssemblyVersion>
108 <AssemblyVersion>4.0.0.0</AssemblyVersion>
111 <Member MemberName="CreatePermission">
112 <MemberSignature Language="ILASM" Value=".method public hidebysig virtual class System.Security.IPermission CreatePermission()" />
113 <MemberSignature Language="C#" Value="public override System.Security.IPermission CreatePermission ();" />
114 <MemberType>Method</MemberType>
116 <ReturnType>System.Security.IPermission</ReturnType>
122 <see cref="T:System.Security.Permissions.EnvironmentPermission" /> that
123 contains the security information of the current instance.</para>
126 <para>A new <see cref="T:System.Security.Permissions.EnvironmentPermission" />
127 object with the security information of the current
131 <block subset="none" type="note">
132 <para>Applications typically do not call this method; it is intended for use by the
134 <para>The security information described by a security attribute is stored in the
135 metadata of the attribute target, and is accessed by the system at run-time. The
136 system uses the object returned by this method to convert the security
137 information of the current instance into the form stored in metadata.</para>
138 <para>This method overrides <see cref="M:System.Security.Permissions.SecurityAttribute.CreatePermission" />.</para>
142 <Excluded>0</Excluded>
144 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
145 <AssemblyVersion>2.0.0.0</AssemblyVersion>
146 <AssemblyVersion>4.0.0.0</AssemblyVersion>
149 <Member MemberName="Read">
150 <MemberSignature Language="ILASM" Value=".property string Read { public hidebysig specialname instance string get_Read() public hidebysig specialname instance void set_Read(string value) }" />
151 <MemberSignature Language="C#" Value="public string Read { set; get; }" />
152 <MemberType>Property</MemberType>
154 <ReturnType>System.String</ReturnType>
159 <para> Gets or sets the environment variables for which read access is
163 <para> A <see cref="T:System.String" />
164 containing one or more environment variables for which read access is secured.</para>
167 <para>Multiple environment variable names are specified by separating the names
168 using the <see cref="F:System.IO.Path.PathSeparator" /> string. Environment variable names are
169 case-insensitive.</para>
171 <block subset="none" type="note">The security action passed to the constructor of the current instance determines how
172 the specified environment variables are secured. For example, if the action is
173 <see cref="F:System.Security.Permissions.SecurityAction.RequestMinimum" /> , then the target
174 of the current instance requires read access to the specified variables in order to
175 execute. If the action is <see cref="F:System.Security.Permissions.SecurityAction.RequestRefuse" />, then the
176 system does not allow the target to read the specified
181 <Excluded>0</Excluded>
183 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
184 <AssemblyVersion>2.0.0.0</AssemblyVersion>
185 <AssemblyVersion>4.0.0.0</AssemblyVersion>
188 <Member MemberName="Write">
189 <MemberSignature Language="ILASM" Value=".property string Write { public hidebysig specialname instance string get_Write() public hidebysig specialname instance void set_Write(string value) }" />
190 <MemberSignature Language="C#" Value="public string Write { set; get; }" />
191 <MemberType>Property</MemberType>
193 <ReturnType>System.String</ReturnType>
199 the environment variables for which write access is secured.</para>
202 <para> A <see cref="T:System.String" /> containing one or more environment variables for which write access is secured.</para>
205 <para>Multiple environment variable names are specified by separating the names
206 using the <see cref="F:System.IO.Path.PathSeparator" /> string. Environment variable names are
207 case-insensitive.</para>
209 <block subset="none" type="note">The security action passed to the
210 constructor of the current instance determines how the specified environment
211 variables are secured. For example, if the action is <see cref="F:System.Security.Permissions.SecurityAction.RequestMinimum" /> , then the target of
212 the current instance requires write access to the specified variables in order
213 to execute. If the action is <see cref="F:System.Security.Permissions.SecurityAction.RequestRefuse" />,
214 then the system does not allow the target to write the specified
219 <Excluded>0</Excluded>
221 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
222 <AssemblyVersion>2.0.0.0</AssemblyVersion>
223 <AssemblyVersion>4.0.0.0</AssemblyVersion>
227 <TypeExcluded>0</TypeExcluded>