1 <Type Name="ReflectionPermission" FullName="System.Security.Permissions.ReflectionPermission" FullNameSP="System_Security_Permissions_ReflectionPermission" Maintainer="ecma">
2 <TypeSignature Language="ILASM" Value=".class public sealed serializable ReflectionPermission extends System.Security.CodeAccessPermission" />
3 <TypeSignature Language="C#" Value="public sealed class ReflectionPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IBuiltInPermission, System.Security.Permissions.IUnrestrictedPermission" />
4 <MemberOfLibrary>Reflection</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.CodeAccessPermission</BaseTypeName>
18 <InterfaceName>System.Security.Permissions.IBuiltInPermission</InterfaceName>
21 <InterfaceName>System.Security.Permissions.IUnrestrictedPermission</InterfaceName>
26 <para> Secures access to the metadata of non-public types and members through reflection.</para>
29 <para>Code with the appropriate <see cref="T:System.Security.Permissions.ReflectionPermission" /> has
30 access to non-public members of a type .
31 Without <see cref="T:System.Security.Permissions.ReflectionPermission" /> ,
32 code can access only the public members of assemblies.</para>
33 <block subset="none" type="note">
34 <para> Without <see cref="T:System.Security.Permissions.ReflectionPermission" />,
35 untrusted code can perform the following operations on members of loaded
40 Obtain type information from metadata for public
41 types and members.</term>
45 Invoke public members.</term>
49 Invoke members defined with family access in the
50 calling code's base classes.</term>
54 Invoke members defined with assembly access in the
55 calling code's assembly.</term>
59 Invoke members defined with <see langword="FamilyAndAssembly" /> or
60 <see langword="FamilyOrAssembly" /> access in the calling code's
61 base classes and/or assembly.</term>
65 Enumerate assemblies.</term>
69 Enumerate public types.</term>
73 Enumerate types in the calling
75 code's assembly.</term>
80 <see cref="T:System.Security.Permissions.ReflectionPermission" /> instances
81 can allow untrusted code to obtain type and member
82 information, invoke members, and enumerate types that would otherwise be inaccessible. <block subset="none" type="note">Because <see cref="T:System.Security.Permissions.ReflectionPermission" /> can
83 provide access to members
85 information that were not intended for public
86 access, it is recommended that <see cref="T:System.Security.Permissions.ReflectionPermission" /> be
87 granted only to trusted code.</block></para>
88 <para>The XML encoding of a <see cref="T:System.Security.Permissions.ReflectionPermission" /> instance is defined below
89 in EBNF format. The following conventions are used: </para>
93 <para> All non-literals in the grammar below are shown in normal type.</para>
98 <para> All literals are in bold font. </para>
102 <para> The following meta-language symbols are used: </para>
106 '*' represents a meta-language symbol suffixing an
107 expression that can appear zero or more times.</term>
111 '?' represents a meta-language symbol suffixing an
112 expression that can appear zero or one time.</term>
116 '+' represents a meta-language symbol suffixing an
117 expression that can appear one or more times.</term>
121 '(',')' is used to group literals, non-literals or a
122 mixture of literals and non-literals.</term>
126 '|' denotes an exclusive disjunction between two
131 '::= ' denotes a production rule where a left hand
132 non-literal is replaced by a right hand expression containing literals,
133 non-literals or both.</term>
136 <para>BuildVersion refers to the build version of the shipping CLI. This is
137 specified as a dotted build number such as '2412.0' . </para>
138 <para>ECMAPubKeyToken ::= <see langword="b77a5c561934e089" /></para>
139 <para>ReflectionPermissionFlag = <see langword="MemberAccess" />
140 | <see langword="TypeInformation" /></para>
141 <para>Each ReflectionPermissionFlag can appear in the XML no more than once. For example, Flags=MemberAccess,MemberAccess is illegal.</para>
142 <para>The XML encoding of a <see cref="T:System.Security.Permissions.ReflectionPermission" />
143 instance is as follows:</para>
144 <para>ReflectionPermissionXML ::=</para>
147 <see langword="<IPermission" />
150 <see langword="class="" />
153 <see langword="System.Security.Permissions.ReflectionPermission, mscorlib," />
156 <see langword="Version=1.0." />BuildVersion<see langword="," /></para>
158 <see langword="Culture=neutral," />
161 <see langword="PublicKeyToken=" />ECMAPubKeyToken<see langword=""" /></para>
163 <see langword="version="1"" />
167 <see langword="Unrestricted="true" " />
173 <see langword="Flags="NoFlags" /> |
174 (ReflectionPermissionFlag (<see langword="," />ReflectionPermissionFlag)*<see langword=""" /></para>
177 <see langword="/>" />
183 <Member MemberName=".ctor">
184 <MemberSignature Language="C#" Value="public ReflectionPermission (System.Security.Permissions.PermissionState state);" />
185 <MemberType>Constructor</MemberType>
187 <Parameter Name="state" Type="System.Security.Permissions.PermissionState" />
190 <param name="state">To be added.</param>
191 <summary>To be added.</summary>
192 <remarks>To be added.</remarks>
195 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
196 <AssemblyVersion>2.0.0.0</AssemblyVersion>
197 <AssemblyVersion>4.0.0.0</AssemblyVersion>
200 <Member MemberName=".ctor">
201 <MemberSignature Language="ILASM" Value="public rtspecialname specialname instance void .ctor(valuetype System.Security.Permissions.ReflectionPermissionFlag flag)" />
202 <MemberSignature Language="C#" Value="public ReflectionPermission (System.Security.Permissions.ReflectionPermissionFlag flag);" />
203 <MemberType>Constructor</MemberType>
206 <Parameter Name="flag" Type="System.Security.Permissions.ReflectionPermissionFlag" />
209 <param name="flag">One or more <see cref="T:System.Security.Permissions.ReflectionPermissionFlag" /> values.</param>
211 <para>Constructs and initializes a new instance of the <see cref="T:System.Security.Permissions.ReflectionPermission" /> class with the specified
214 <remarks>To be added.</remarks>
215 <exception cref="T:System.ArgumentException">The <paramref name="flag" /> parameter contains a value that is not a combination of <see cref="T:System.Security.Permissions.ReflectionPermissionFlag" /> values.</exception>
217 <Excluded>0</Excluded>
219 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
220 <AssemblyVersion>2.0.0.0</AssemblyVersion>
221 <AssemblyVersion>4.0.0.0</AssemblyVersion>
224 <Member MemberName="Copy">
225 <MemberSignature Language="ILASM" Value=".method public hidebysig virtual class System.Security.IPermission Copy()" />
226 <MemberSignature Language="C#" Value="public override System.Security.IPermission Copy ();" />
227 <MemberType>Method</MemberType>
229 <ReturnType>System.Security.IPermission</ReturnType>
234 <para>Returns a new <see cref="T:System.Security.Permissions.ReflectionPermission" /> object containing the same values as the current
238 <para>A new <see cref="T:System.Security.Permissions.ReflectionPermission" /> instance that contains the same values as the current instance.</para>
241 <block subset="none" type="note">
242 <para>The object returned by this method represents the same access to resources as
243 the current instance.</para>
244 <para>This method overrides <see cref="M:System.Security.CodeAccessPermission.Copy" qualify="true" /> and is implemented to
245 support the <see cref="T:System.Security.IPermission" /> interface.</para>
249 <Excluded>0</Excluded>
251 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
252 <AssemblyVersion>2.0.0.0</AssemblyVersion>
253 <AssemblyVersion>4.0.0.0</AssemblyVersion>
256 <Member MemberName="Flags">
257 <MemberSignature Language="C#" Value="public System.Security.Permissions.ReflectionPermissionFlag Flags { set; get; }" />
258 <MemberType>Property</MemberType>
260 <ReturnType>System.Security.Permissions.ReflectionPermissionFlag</ReturnType>
263 <summary>To be added.</summary>
264 <value>To be added.</value>
265 <remarks>To be added.</remarks>
268 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
269 <AssemblyVersion>2.0.0.0</AssemblyVersion>
270 <AssemblyVersion>4.0.0.0</AssemblyVersion>
273 <Member MemberName="FromXml">
274 <MemberSignature Language="ILASM" Value=".method public hidebysig virtual void FromXml(class System.Security.SecurityElement esd)" />
275 <MemberSignature Language="C#" Value="public override void FromXml (System.Security.SecurityElement esd);" />
276 <MemberType>Method</MemberType>
278 <ReturnType>System.Void</ReturnType>
281 <Parameter Name="esd" Type="System.Security.SecurityElement" />
284 <param name="esd">A <see cref="T:System.Security.SecurityElement" /> instance containing the XML encoding to use to reconstruct the state of a <see cref="T:System.Security.Permissions.ReflectionPermission" /> object.</param>
286 <para>Reconstructs the state of a
287 <see cref="T:System.Security.Permissions.ReflectionPermission" /> object using the specified XML
291 <para>The state of the current instance is changed to the state encoded in
292 <paramref name="esd" />.</para>
293 <block subset="none" type="note">
294 <para>For the XML encoding for this class, see the
295 <see cref="T:System.Security.Permissions.ReflectionPermission" /> class
297 <para>This method overrides <see cref="M:System.Security.CodeAccessPermission.FromXml(System.Security.SecurityElement)" qualify="true" /> .</para>
300 <exception cref="T:System.ArgumentNullException">The <paramref name="esd" /> parameter is <see langword="null" />.</exception>
301 <exception cref="T:System.ArgumentException">
302 <para>The <paramref name="esd" /> parameter is not a <see cref="T:System.Security.Permissions.ReflectionPermission" /> element.</para>
304 <para>The <paramref name="esd" /> parameter's version number is not valid.</para>
307 <Excluded>0</Excluded>
309 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
310 <AssemblyVersion>2.0.0.0</AssemblyVersion>
311 <AssemblyVersion>4.0.0.0</AssemblyVersion>
314 <Member MemberName="Intersect">
315 <MemberSignature Language="ILASM" Value=".method public hidebysig virtual class System.Security.IPermission Intersect(class System.Security.IPermission target)" />
316 <MemberSignature Language="C#" Value="public override System.Security.IPermission Intersect (System.Security.IPermission target);" />
317 <MemberType>Method</MemberType>
319 <ReturnType>System.Security.IPermission</ReturnType>
322 <Parameter Name="target" Type="System.Security.IPermission" />
325 <param name="target">A <see cref="T:System.Security.Permissions.ReflectionPermission" /> instance to intersect with the current instance. </param>
327 <para>Returns a new <see cref="T:System.Security.Permissions.ReflectionPermission" /> object that is the intersection
328 of the current instance and the specified object.</para>
331 <para>A new <see cref="T:System.Security.Permissions.ReflectionPermission" /> instance that represents the intersection of the
332 current instance and <paramref name="target" />. If the intersection is empty, returns
333 <see langword="null" />. If <paramref name="target" /> is
334 <see langword="null" />, returns <see langword="null" />
338 <block subset="none" type="note">
339 <para>The intersection of two permissions is a permission that secures the
340 resources and operations secured by both permissions. Specifically, it
341 represents the minimum permission such that any demand that passes both
342 permissions will also pass their intersection.</para>
343 <para>This method overrides <see cref="M:System.Security.CodeAccessPermission.Intersect(System.Security.IPermission)" qualify="true" /> and is implemented to
344 support the <see cref="T:System.Security.IPermission" /> interface.</para>
347 <exception cref="T:System.ArgumentException">The <paramref name="target" /> parameter is not <see langword="null" /> and is not an instance of <see cref="T:System.Security.Permissions.ReflectionPermission" /> . </exception>
349 <Excluded>0</Excluded>
351 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
352 <AssemblyVersion>2.0.0.0</AssemblyVersion>
353 <AssemblyVersion>4.0.0.0</AssemblyVersion>
356 <Member MemberName="IsSubsetOf">
357 <MemberSignature Language="ILASM" Value=".method public hidebysig virtual bool IsSubsetOf(class System.Security.IPermission target)" />
358 <MemberSignature Language="C#" Value="public override bool IsSubsetOf (System.Security.IPermission target);" />
359 <MemberType>Method</MemberType>
361 <ReturnType>System.Boolean</ReturnType>
364 <Parameter Name="target" Type="System.Security.IPermission" />
367 <param name="target">A <see cref="T:System.Security.Permissions.ReflectionPermission" /> instance that is to be tested for the subset relationship.</param>
369 <para> Determines whether the current instance is a subset of
370 the specified object.</para>
374 <see langword="true" /> if the current instance is a subset of <paramref name="target" /> ;
375 otherwise,<see langword=" false" />. If the current instance is unrestricted, and
376 <paramref name="target" /> is not, returns <see langword="false" />. If <paramref name="target" /> is
377 unrestricted, returns <see langword="true" />. If target is
378 <see langword="null" /> and the access level of the current instance is <see cref="F:System.Security.Permissions.ReflectionPermissionFlag.NoFlags" />, returns <see langword="true" />. If
379 target is <see langword="null" /> and the access level of the current
380 instance is any value other than <see cref="F:System.Security.Permissions.ReflectionPermissionFlag.NoFlags" />, returns
381 <see langword="false" />.</para>
384 <block subset="none" type="note">
385 <para>The current instance is a subset of <paramref name="target" /> if the current instance
386 specifies a set of accesses to resources that is wholly contained by
387 <paramref name="target" /> . For example, a permission that represents access to type
388 information is a subset of a permission that represents access to type information and members. </para>
389 <para>This method overrides <see cref="M:System.Security.CodeAccessPermission.IsSubsetOf(System.Security.IPermission)" qualify="true" /> and is implemented to
390 support the <see cref="T:System.Security.IPermission" /> interface.</para>
393 <exception cref="T:System.ArgumentException">The <paramref name="target" /> parameter is not <see langword="null" /> and is not an instance of <see cref="T:System.Security.Permissions.ReflectionPermission" /> . </exception>
395 <Excluded>0</Excluded>
397 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
398 <AssemblyVersion>2.0.0.0</AssemblyVersion>
399 <AssemblyVersion>4.0.0.0</AssemblyVersion>
402 <Member MemberName="IsUnrestricted">
403 <MemberSignature Language="C#" Value="public bool IsUnrestricted ();" />
404 <MemberType>Method</MemberType>
406 <ReturnType>System.Boolean</ReturnType>
410 <summary>To be added.</summary>
411 <returns>To be added.</returns>
412 <remarks>To be added.</remarks>
415 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
416 <AssemblyVersion>2.0.0.0</AssemblyVersion>
417 <AssemblyVersion>4.0.0.0</AssemblyVersion>
420 <Member MemberName="System.Security.Permissions.IBuiltInPermission.GetTokenIndex">
421 <MemberSignature Language="C#" Value="int IBuiltInPermission.GetTokenIndex ();" />
422 <MemberType>Method</MemberType>
424 <ReturnType>System.Int32</ReturnType>
428 <summary>To be added.</summary>
429 <returns>To be added.</returns>
430 <remarks>To be added.</remarks>
433 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
434 <AssemblyVersion>2.0.0.0</AssemblyVersion>
435 <AssemblyVersion>4.0.0.0</AssemblyVersion>
438 <Member MemberName="ToXml">
439 <MemberSignature Language="ILASM" Value=".method public hidebysig virtual class System.Security.SecurityElement ToXml()" />
440 <MemberSignature Language="C#" Value="public override System.Security.SecurityElement ToXml ();" />
441 <MemberType>Method</MemberType>
443 <ReturnType>System.Security.SecurityElement</ReturnType>
448 <para>Returns the XML encoding of the current instance.</para>
451 <para>A <see cref="T:System.Security.SecurityElement" /> containing the XML encoding of the state of the current
455 <block subset="none" type="note">
456 <para>For the XML encoding for this class, see the <see cref="T:System.Security.Permissions.ReflectionPermission" /> class page.</para>
457 <para>This method overrides <see cref="M:System.Security.CodeAccessPermission.ToXml" qualify="true" /> .</para>
461 <Excluded>0</Excluded>
463 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
464 <AssemblyVersion>2.0.0.0</AssemblyVersion>
465 <AssemblyVersion>4.0.0.0</AssemblyVersion>
468 <Member MemberName="Union">
469 <MemberSignature Language="ILASM" Value=".method public hidebysig virtual class System.Security.IPermission Union(class System.Security.IPermission other)" />
470 <MemberSignature Language="C#" Value="public override System.Security.IPermission Union (System.Security.IPermission other);" />
471 <MemberType>Method</MemberType>
473 <ReturnType>System.Security.IPermission</ReturnType>
476 <Parameter Name="other" Type="System.Security.IPermission" />
479 <param name="other">A <see cref="T:System.Security.Permissions.ReflectionPermission" /> instance to be combined with the current instance. </param>
481 <para>Returns a new <see cref="T:System.Security.Permissions.ReflectionPermission" /> object that is the union of the
482 current instance and the specified object.</para>
485 <para>A new <see cref="T:System.Security.Permissions.ReflectionPermission" />
486 instance that represents the union of the current instance and <paramref name="other" />. If
487 the current instance or <paramref name="other " />is unrestricted, returns a
488 <see cref="T:System.Security.Permissions.ReflectionPermission" /> instance that is
489 unrestricted. If <paramref name="other" /> is <see langword="null" />, returns a copy of the
490 current instance.</para>
493 <block subset="none" type="note">
494 <para>The result of a call to <see cref="M:System.Security.Permissions.ReflectionPermission.Union(System.Security.IPermission)" />
495 is a permission that represents all of the access
496 to resources represented by both the current instance and <paramref name="other" />. Any
497 demand that passes either the current instance or <paramref name="other " />passes their
499 <para>This method overrides <see cref="M:System.Security.CodeAccessPermission.Union(System.Security.IPermission)" qualify="true" /> and is implemented to
500 support the <see cref="T:System.Security.IPermission" /> interface.</para>
503 <exception cref="T:System.ArgumentException">The <paramref name="other " />parameter is not <see langword="null" /> and is not an instance of <see cref="T:System.Security.Permissions.ReflectionPermission" /> .</exception>
505 <Excluded>0</Excluded>
507 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
508 <AssemblyVersion>2.0.0.0</AssemblyVersion>
509 <AssemblyVersion>4.0.0.0</AssemblyVersion>
513 <TypeExcluded>0</TypeExcluded>
516 <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>