The methods of the CodeAccessPermission class are listed below. For a complete list of CodeAccessPermission class members, see the CodeAccessPermission Members topic.
Assert | Asserts that the calling code can access the resource identified by the current permission object, even if callers have not been granted permission to access the resource. Calling the Assert method stops the check on previous callers in the call chain. Therefore, even if previous callers do not have the requisite permissions, they can still access resources.
Warning: Because calling the Assert method removes the requirement that all code in the call chain must be granted permission to access the specified resource, it can open up security holes if used incorrectly or inappropriately. Therefore, it should be used with great caution. |
CheckDemand | When implemented by a subclass of CodeAccessPermission, this method determines whether the current permission object represents the ability to access the resource in the manner specified by the demand argument. |
Copy | When implemented by a subclass, this method creates and returns an identical copy of the current permission object. |
Demand | Determines at run-time whether all callers in the call chain have been granted the permission specified by the current permission object. |
DemandImmediate | Determines whether the immediate caller of the code that calls this method has been granted the permission specified by the current permission object. |
Deny | Deny callers in the call chain the ability to access the resource specified by the current permission object. This method prevents callers from accessing the protected resource even if they have been granted permission to access it. |
Equals (inherited from Object) | Determines whether the specified Object is the same instance as the current Object. Subclasses are expected to override this method to support value equality (not reference equality). |
FromXml | Reconstructs a security object with a given state from an XML encoding. |
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table. |
GetType (inherited from Object) | Gets the Type of the Object. |
Intersect | When implemented by a subclass, this method creates and returns a permission that is the intersection of the current permission object and a target permission object. |
IsSubsetOf | When implemented by a subclass, this method determines whether the current permission object is a subset of the specified permission. |
PermitOnly | Ensures that only the resources specified by this permission object can be accessed, even if the code has been granted permission to access other resources. |
RevertAll | This method causes all previous overrides for the current frame (assert, deny, and/or permit-only) to be removed and no longer in effect. |
RevertAssert | This method causes any previous assert for the current frame to be removed and no longer in effect. |
RevertDeny | This method causes previous deny for the current frame to be removed and no longer in effect. |
RevertPermitOnly | This method causes a previous permit-only for the current frame to be removed and no longer in effect. |
ToString | Creates and returns a String representation for the current permission object. |
ToXml | Creates an XML encoding, of the security object and its current state. |
Union | Creates a permission that is the union of the permission object and the target parameter permission object. |
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by the Garbage Collector (GC). This method may be ignored by the runtime; therefore, necessary cleanup operations should be done elsewhere. |
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object. |