InteropPermission Class

Definition

The InteropPermission class controls the ability to call unmanaged and managed code.

public ref class InteropPermission : Microsoft::Dynamics::Ax::Xpp::CodeAccessPermission
[Microsoft.Dynamics.Ax.Xpp.KernelClass]
public class InteropPermission : Microsoft.Dynamics.Ax.Xpp.CodeAccessPermission
[<Microsoft.Dynamics.Ax.Xpp.KernelClass>]
type InteropPermission = class
    inherit CodeAccessPermission
Public Class InteropPermission
Inherits CodeAccessPermission
Inheritance
Microsoft.Dynamics.AX.KernelInterop.ProxyBase
InteropPermission
Attributes

Remarks

The InteropPermission class is designed to check permissions for specific APIs. For a list of all APIs that are protected by permissions, see Secured APIs. Before the protected API is run, you must call the assert method on the same tier (usually the server tier) that the corresponding CodeAccessPermission::demand method is called on. Call a method on the server tier from one of the following methods:

  • A server static method
  • A class instance method that is set to run on the server by using the RunOn class property.

The following code example shows a new instance of the InteropPermission class. The assert method is called to declare that the code can then instantiate the DLL class that provides the ability to communicate with a Microsoft Windows dynamic-link library (DLL).

server static void main(Args args) 
{ 
    InteropPermission _perm; 
    DLL _dll; 
    _perm = new InteropPermission(InteropKind::DllInterop); 
    _perm.assert(); 
    // Invoke the protected API. 
    _dll = new DLL('cfx2032.dll'); 
    // Optionally, call revertAssert() to limit the scope of assert. 
    CodeAccessPermission::revertAssert(); 
}

Constructors

InteropPermission()
InteropPermission(InteropKind)
InteropPermission(IntPtr)

Fields

__k_InteropPermissionId
kernelClass (Inherited from XppObjectBase)

Methods

__shouldCallNew(Type)
addXppProxyReference(Type, Object) (Inherited from XppObjectBase)
assert()

Declares that the calling code can invoke an API that is protected by a permission.

(Inherited from CodeAccessPermission)
Call(String, Object[], Type[], Object[]) (Inherited from XppObjectBase)
cancelTimeOut(Int32) (Inherited from XppObjectBase)
Copy()

Creates and returns a copy of the current permission class object.

createKernelClass(Object[], Type[], Object[]) (Inherited from XppObjectBase)
demand()

Checks the call stack to determine whether the permission that is required to invoke an API has been granted to the calling code.

(Inherited from CodeAccessPermission)
equal(XppObjectBase) (Inherited from XppObjectBase)
finalize() (Inherited from XppObjectBase)
GetIntPtr() (Inherited from XppObjectBase)
GetKernelInstanceUniqueId() (Inherited from XppObjectBase)
getTimeOutTimerHandle() (Inherited from XppObjectBase)
getXppProxyReference(Type) (Inherited from XppObjectBase)
handle()
IsManagedValid() (Inherited from XppObjectBase)
Issubsetof(CodeAccessPermission)

Determines whether the current permission is a subset of the specified permission.

kernelhandle()
KernelInstanceDisposed() (Inherited from XppObjectBase)
MakeReflectionCall(String, Object[]) (Inherited from XppObjectBase)
newmethod()

Initializes a new instance of the CodeAccessPermission class.

(Inherited from CodeAccessPermission)
newmethod(InteropKind)

Creates a new instance of the InteropPermission class.

notify() (Inherited from XppObjectBase)
notifyAll() (Inherited from XppObjectBase)
objectOnServer()
Obsolete.
(Inherited from XppObjectBase)
setTimeOut(String, Int32)
Obsolete.
(Inherited from XppObjectBase)
setTimeOut(String, Int32, Boolean)
Obsolete.
(Inherited from XppObjectBase)
usageCount() (Inherited from XppObjectBase)
VerifyKernelClass() (Inherited from XppObjectBase)
wait() (Inherited from XppObjectBase)
Xml() (Inherited from XppObjectBase)
Xml(Int32) (Inherited from XppObjectBase)

Applies to