13 private const string _strHeaderAssertion =
"Assertion";
15 private const string _strHeaderUnmanagedCode =
"UnmanagedCode";
17 private const string _strHeaderExecution =
"Execution";
19 private const string _strHeaderSkipVerification =
"SkipVerification";
21 private const string _strHeaderControlThread =
"ControlThread";
23 private const string _strHeaderControlEvidence =
"ControlEvidence";
25 private const string _strHeaderControlPolicy =
"ControlPolicy";
27 private const string _strHeaderSerializationFormatter =
"SerializationFormatter";
29 private const string _strHeaderControlDomainPolicy =
"ControlDomainPolicy";
31 private const string _strHeaderControlPrincipal =
"ControlPrincipal";
33 private const string _strHeaderControlAppDomain =
"ControlAppDomain";
59 SetUnrestricted(unrestricted:
true);
62 SetUnrestricted(unrestricted:
false);
76 SetUnrestricted(unrestricted:
false);
80 private void SetUnrestricted(
bool unrestricted)
105 if (securityPermission !=
null)
122 if (!VerifyType(target))
145 if (!VerifyType(target))
153 securityPermissionFlag = ((!
IsUnrestricted()) ? (m_flags & securityPermission.m_flags) : securityPermission.m_flags);
161 securityPermissionFlag = m_flags;
210 return securityElement;
220 if (XMLUtil.IsUnrestricted(esd))
226 SetUnrestricted(unrestricted:
false);
227 string text = esd.Attribute(
"Flags");
234 int IBuiltInPermission.GetTokenIndex()
236 return GetTokenIndex();
239 internal static int GetTokenIndex()
SecurityPermissionFlag Flags
Gets or sets the security permission flags.
Allows a permission to expose an unrestricted state.
Describes a set of security permissions applied to code. This class cannot be inherited.
SecurityPermission(SecurityPermissionFlag flag)
Initializes a new instance of the T:System.Security.Permissions.SecurityPermission class with the spe...
override SecurityElement ToXml()
Creates an XML encoding of the permission and its current state.
override IPermission Copy()
Creates and returns an identical copy of the current permission.
override bool IsSubsetOf(IPermission target)
Determines whether the current permission is a subset of the specified permission.
override void FromXml(SecurityElement esd)
Reconstructs a permission with a specified state from an XML encoding.
static object Parse(Type enumType, string value)
Converts the string representation of the name or numeric value of one or more enumerated constants t...
Provides information about, and means to manipulate, the current environment and platform....
Provides the base class for enumerations.
Represents the XML object model for encoding security objects. This class cannot be inherited.
SecurityPermission(PermissionState state)
Initializes a new instance of the T:System.Security.Permissions.SecurityPermission class with either ...
Defines the underlying structure of all code access permissions.
Defines methods implemented by permission types.
The exception that is thrown when one of the arguments provided to a method is not valid.
override IPermission Intersect(IPermission target)
Creates and returns a permission that is the intersection of the current permission and the specified...
PermissionState
Specifies whether a permission should have all or no access to resources at creation.
override IPermission Union(IPermission target)
Creates a permission that is the union of the current permission and the specified permission.
void AddAttribute(string name, string value)
Adds a name/value attribute to an XML element.
Specifies that the class can be serialized.
SecurityPermissionFlag
Specifies access flags for the security permission object.
bool IsUnrestricted()
Returns a value indicating whether the current permission is unrestricted.