d425b1eb8dcda9077da868b0d6788eb8278f3cf0
[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     <AssemblyVersion>4.0.0.0</AssemblyVersion>
11   </AssemblyInfo>
12   <ThreadingSafetyStatement>All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.</ThreadingSafetyStatement>
13   <Base>
14     <BaseTypeName>System.Security.Permissions.CodeAccessSecurityAttribute</BaseTypeName>
15   </Base>
16   <Interfaces />
17   <Attributes>
18     <Attribute>
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>
20     </Attribute>
21     <Attribute>
22       <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
23     </Attribute>
24   </Attributes>
25   <Docs>
26     <summary>
27       <para>Used to declaratively specify security actions to control
28       access to environment variables.</para>
29     </summary>
30     <remarks>
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" />
33       string.</para>
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" />
43          .</para>
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>
46       </block>
47     </remarks>
48     <example>
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
53       to execute.</para>
54       <para>
55         <c>[assembly:EnvironmentPermissionAttribute(SecurityAction.RequestMinimum, Read="COMPUTERNAME;USERNAME;USERDOMAIN")]
56    </c>
57       </para>
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>
62       <para>
63         <c>[EnvironmentPermissionAttribute(SecurityAction.Demand, Unrestricted=true)]
64    </c>
65       </para>
66     </example>
67   </Docs>
68   <Members>
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>
73       <ReturnValue />
74       <Parameters>
75         <Parameter Name="action" Type="System.Security.Permissions.SecurityAction" />
76       </Parameters>
77       <Docs>
78         <param name="action">A <see cref="T:System.Security.Permissions.SecurityAction" /> value.</param>
79         <summary>
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>
82         </summary>
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>
86       </Docs>
87       <Excluded>0</Excluded>
88       <AssemblyInfo>
89         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
90         <AssemblyVersion>2.0.0.0</AssemblyVersion>
91         <AssemblyVersion>4.0.0.0</AssemblyVersion>
92       </AssemblyInfo>
93     </Member>
94     <Member MemberName="All">
95       <MemberSignature Language="C#" Value="public string All { set; get; }" />
96       <MemberType>Property</MemberType>
97       <ReturnValue>
98         <ReturnType>System.String</ReturnType>
99       </ReturnValue>
100       <Docs>
101         <summary>To be added.</summary>
102         <value>To be added.</value>
103         <remarks>To be added.</remarks>
104       </Docs>
105       <AssemblyInfo>
106         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
107         <AssemblyVersion>2.0.0.0</AssemblyVersion>
108         <AssemblyVersion>4.0.0.0</AssemblyVersion>
109       </AssemblyInfo>
110     </Member>
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>
115       <ReturnValue>
116         <ReturnType>System.Security.IPermission</ReturnType>
117       </ReturnValue>
118       <Parameters />
119       <Docs>
120         <summary>
121           <para> Returns a new 
122    <see cref="T:System.Security.Permissions.EnvironmentPermission" /> that
123       contains the security information of the current instance.</para>
124         </summary>
125         <returns>
126           <para>A new <see cref="T:System.Security.Permissions.EnvironmentPermission" />
127 object with the security information of the current
128 instance.</para>
129         </returns>
130         <remarks>
131           <block subset="none" type="note">
132             <para>Applications typically do not call this method; it is intended for use by the
133          system.</para>
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>
139           </block>
140         </remarks>
141       </Docs>
142       <Excluded>0</Excluded>
143       <AssemblyInfo>
144         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
145         <AssemblyVersion>2.0.0.0</AssemblyVersion>
146         <AssemblyVersion>4.0.0.0</AssemblyVersion>
147       </AssemblyInfo>
148     </Member>
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>
153       <ReturnValue>
154         <ReturnType>System.String</ReturnType>
155       </ReturnValue>
156       <Parameters />
157       <Docs>
158         <summary>
159           <para> Gets or sets the environment variables for which read access is
160  secured.</para>
161         </summary>
162         <value>
163           <para> A <see cref="T:System.String" />
164 containing one or more environment variables for which read access is secured.</para>
165         </value>
166         <remarks>
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>
170           <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
177  variables.</block>
178           </para>
179         </remarks>
180       </Docs>
181       <Excluded>0</Excluded>
182       <AssemblyInfo>
183         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
184         <AssemblyVersion>2.0.0.0</AssemblyVersion>
185         <AssemblyVersion>4.0.0.0</AssemblyVersion>
186       </AssemblyInfo>
187     </Member>
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>
192       <ReturnValue>
193         <ReturnType>System.String</ReturnType>
194       </ReturnValue>
195       <Parameters />
196       <Docs>
197         <summary>
198           <para> Gets or sets
199  the environment variables for which write access is secured.</para>
200         </summary>
201         <value>
202           <para> A <see cref="T:System.String" /> containing one or more environment variables for which write access is secured.</para>
203         </value>
204         <remarks>
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>
208           <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
215  variables.</block>
216           </para>
217         </remarks>
218       </Docs>
219       <Excluded>0</Excluded>
220       <AssemblyInfo>
221         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
222         <AssemblyVersion>2.0.0.0</AssemblyVersion>
223         <AssemblyVersion>4.0.0.0</AssemblyVersion>
224       </AssemblyInfo>
225     </Member>
226   </Members>
227   <TypeExcluded>0</TypeExcluded>
228 </Type>