123a76140666644c40fbaa44b1bb7d4fdd91a97c
[mono.git] / mcs / class / corlib / Documentation / en / System.Security.Permissions / EnvironmentPermissionAttribute.xml
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>
5   <AssemblyInfo>
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   </AssemblyInfo>
11   <ThreadingSafetyStatement>All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.</ThreadingSafetyStatement>
12   <Base>
13     <BaseTypeName>System.Security.Permissions.CodeAccessSecurityAttribute</BaseTypeName>
14   </Base>
15   <Interfaces />
16   <Attributes>
17     <Attribute>
18       <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>
19     </Attribute>
20     <Attribute>
21       <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
22     </Attribute>
23   </Attributes>
24   <Docs>
25     <summary>
26       <para>Used to declaratively specify security actions to control
27       access to environment variables.</para>
28     </summary>
29     <remarks>
30       <para>Environment variable names are case-insensitive. Multiple environment variable names are specified by separating the names
31       using the <see cref="F:System.IO.Path.PathSeparator" />
32       string.</para>
33       <block subset="none" type="note">
34         <para> The level of access to one or more environment variables is
35          specified using the members of the current instance. For example, to specify
36          read permissions for an environment variable, set the <see cref="P:System.Security.Permissions.EnvironmentPermissionAttribute.Read" /> property equal
37          to the name of the environment variable.</para>
38         <para> The security information declared by a security attribute is stored in the
39          metadata of the attribute target, and is accessed by the system at run-time.
40          Security attributes are used for declarative security only. For imperative
41          security, use the corresponding permission class, <see cref="T:System.Security.Permissions.EnvironmentPermission" />
42          .</para>
43         <para>The allowable <see cref="T:System.Security.Permissions.EnvironmentPermissionAttribute" /> targets are determined by the
44    <see cref="T:System.Security.Permissions.SecurityAction" /> passed to the constructor.</para>
45       </block>
46     </remarks>
47     <example>
48       <para> The following example shows a declarative request for
49       the ability to read the specified environment variables. The <see cref="F:System.Security.Permissions.SecurityAction.RequestMinimum" />
50       security action indicates
51       that this is the minimum permission required for the target assembly to be able
52       to execute.</para>
53       <para>
54         <c>[assembly:EnvironmentPermissionAttribute(SecurityAction.RequestMinimum, Read="COMPUTERNAME;USERNAME;USERDOMAIN")]
55    </c>
56       </para>
57       <para>The following example shows how to demand that the
58       calling code has unrestricted access to all environment variables. Demands are
59       typically made in managed libraries to protect methods or classes from
60       malicious code.</para>
61       <para>
62         <c>[EnvironmentPermissionAttribute(SecurityAction.Demand, Unrestricted=true)]
63    </c>
64       </para>
65     </example>
66   </Docs>
67   <Members>
68     <Member MemberName=".ctor">
69       <MemberSignature Language="ILASM" Value="public rtspecialname specialname instance void .ctor(valuetype System.Security.Permissions.SecurityAction action)" />
70       <MemberSignature Language="C#" Value="public EnvironmentPermissionAttribute (System.Security.Permissions.SecurityAction action);" />
71       <MemberType>Constructor</MemberType>
72       <ReturnValue />
73       <Parameters>
74         <Parameter Name="action" Type="System.Security.Permissions.SecurityAction" />
75       </Parameters>
76       <Docs>
77         <param name="action">A <see cref="T:System.Security.Permissions.SecurityAction" /> value.</param>
78         <summary>
79           <para>Constructs and initializes a new instance of the <see cref="T:System.Security.Permissions.EnvironmentPermissionAttribute" /> class
80  with the specified <see cref="T:System.Security.Permissions.SecurityAction" /> value.</para>
81         </summary>
82         <remarks>To be added.</remarks>
83         <exception cref="T:System.ArgumentException">
84           <paramref name="action" /> is not a valid <see cref="T:System.Security.Permissions.SecurityAction" /> value. </exception>
85       </Docs>
86       <Excluded>0</Excluded>
87       <AssemblyInfo>
88         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
89         <AssemblyVersion>2.0.0.0</AssemblyVersion>
90       </AssemblyInfo>
91     </Member>
92     <Member MemberName="All">
93       <MemberSignature Language="C#" Value="public string All { set; get; }" />
94       <MemberType>Property</MemberType>
95       <ReturnValue>
96         <ReturnType>System.String</ReturnType>
97       </ReturnValue>
98       <Docs>
99         <summary>To be added.</summary>
100         <value>To be added.</value>
101         <remarks>To be added.</remarks>
102       </Docs>
103       <AssemblyInfo>
104         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
105         <AssemblyVersion>2.0.0.0</AssemblyVersion>
106       </AssemblyInfo>
107     </Member>
108     <Member MemberName="CreatePermission">
109       <MemberSignature Language="ILASM" Value=".method public hidebysig virtual class System.Security.IPermission CreatePermission()" />
110       <MemberSignature Language="C#" Value="public override System.Security.IPermission CreatePermission ();" />
111       <MemberType>Method</MemberType>
112       <ReturnValue>
113         <ReturnType>System.Security.IPermission</ReturnType>
114       </ReturnValue>
115       <Parameters />
116       <Docs>
117         <summary>
118           <para> Returns a new 
119    <see cref="T:System.Security.Permissions.EnvironmentPermission" /> that
120       contains the security information of the current instance.</para>
121         </summary>
122         <returns>
123           <para>A new <see cref="T:System.Security.Permissions.EnvironmentPermission" />
124 object with the security information of the current
125 instance.</para>
126         </returns>
127         <remarks>
128           <block subset="none" type="note">
129             <para>Applications typically do not call this method; it is intended for use by the
130          system.</para>
131             <para>The security information described by a security attribute is stored in the
132          metadata of the attribute target, and is accessed by the system at run-time. The
133          system uses the object returned by this method to convert the security
134          information of the current instance into the form stored in metadata.</para>
135             <para>This method overrides <see cref="M:System.Security.Permissions.SecurityAttribute.CreatePermission" />.</para>
136           </block>
137         </remarks>
138       </Docs>
139       <Excluded>0</Excluded>
140       <AssemblyInfo>
141         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
142         <AssemblyVersion>2.0.0.0</AssemblyVersion>
143       </AssemblyInfo>
144     </Member>
145     <Member MemberName="Read">
146       <MemberSignature Language="ILASM" Value=".property string Read { public hidebysig specialname instance string get_Read() public hidebysig specialname instance void set_Read(string value) }" />
147       <MemberSignature Language="C#" Value="public string Read { set; get; }" />
148       <MemberType>Property</MemberType>
149       <ReturnValue>
150         <ReturnType>System.String</ReturnType>
151       </ReturnValue>
152       <Parameters />
153       <Docs>
154         <summary>
155           <para> Gets or sets the environment variables for which read access is
156  secured.</para>
157         </summary>
158         <value>
159           <para> A <see cref="T:System.String" />
160 containing one or more environment variables for which read access is secured.</para>
161         </value>
162         <remarks>
163           <para>Multiple environment variable names are specified by separating the names
164  using the <see cref="F:System.IO.Path.PathSeparator" /> string. Environment variable names are
165  case-insensitive.</para>
166           <para>
167             <block subset="none" type="note">The security action passed to the constructor of the current instance determines how
168  the specified environment variables are secured. For example, if the action is
169  <see cref="F:System.Security.Permissions.SecurityAction.RequestMinimum" /> , then the target
170  of the current instance requires read access to the specified variables in order to
171  execute. If the action is <see cref="F:System.Security.Permissions.SecurityAction.RequestRefuse" />, then the
172  system does not allow the target to read the specified
173  variables.</block>
174           </para>
175         </remarks>
176       </Docs>
177       <Excluded>0</Excluded>
178       <AssemblyInfo>
179         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
180         <AssemblyVersion>2.0.0.0</AssemblyVersion>
181       </AssemblyInfo>
182     </Member>
183     <Member MemberName="Write">
184       <MemberSignature Language="ILASM" Value=".property string Write { public hidebysig specialname instance string get_Write() public hidebysig specialname instance void set_Write(string value) }" />
185       <MemberSignature Language="C#" Value="public string Write { set; get; }" />
186       <MemberType>Property</MemberType>
187       <ReturnValue>
188         <ReturnType>System.String</ReturnType>
189       </ReturnValue>
190       <Parameters />
191       <Docs>
192         <summary>
193           <para> Gets or sets
194  the environment variables for which write access is secured.</para>
195         </summary>
196         <value>
197           <para> A <see cref="T:System.String" /> containing one or more environment variables for which write access is secured.</para>
198         </value>
199         <remarks>
200           <para>Multiple environment variable names are specified by separating the names
201  using the <see cref="F:System.IO.Path.PathSeparator" /> string. Environment variable names are
202  case-insensitive.</para>
203           <para>
204             <block subset="none" type="note">The security action passed to the
205  constructor of the current instance determines how the specified environment
206  variables are secured. For example, if the action is <see cref="F:System.Security.Permissions.SecurityAction.RequestMinimum" /> , then the target of
207  the current instance requires write access to the specified variables in order
208  to execute. If the action is <see cref="F:System.Security.Permissions.SecurityAction.RequestRefuse" />,
209  then the system does not allow the target to write the specified
210  variables.</block>
211           </para>
212         </remarks>
213       </Docs>
214       <Excluded>0</Excluded>
215       <AssemblyInfo>
216         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
217         <AssemblyVersion>2.0.0.0</AssemblyVersion>
218       </AssemblyInfo>
219     </Member>
220   </Members>
221   <TypeExcluded>0</TypeExcluded>
222 </Type>